[PATCH] ext4: fallocate_zero_range, check if is regular file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



fallocate_zero_range, check if inode is regular file.

Signed-off-by: Jon Ernst <jonernst07@xxxxxxxxx>
---
 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
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux