linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ext4: fallocate_zero_range, check if is regular file
@ 2014-04-17  4:22 jon ernst
  2014-04-17 11:08 ` Lukáš Czerner
  2014-04-18  7:50 ` Ashish Sangwan
  0 siblings, 2 replies; 4+ messages in thread
From: jon ernst @ 2014-04-17  4:22 UTC (permalink / raw)
  To: linux-ext4@vger.kernel.org List

fallocate_zero_range, check if inode is regular file.

Signed-off-by: Jon Ernst <jonernst07@gmail.com>
---
 fs/ext4/extents.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index 1bb3e4b..756a3b9 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -4742,6 +4742,8 @@ static long ext4_zero_range(struct file *file,
loff_t offset,

    trace_ext4_zero_range(inode, offset, len, mode);

+   if (!S_ISREG(inode->i_mode))
+       return -EOPNOTSUPP;
    /*
     * Write out all dirty pages to avoid race conditions
     * Then release them.
-- 
1.8.1.2

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-04-18 15:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-17  4:22 [PATCH] ext4: fallocate_zero_range, check if is regular file jon ernst
2014-04-17 11:08 ` Lukáš Czerner
2014-04-18  7:50 ` Ashish Sangwan
2014-04-18 15:52   ` Theodore Ts'o

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).