aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2011-01-14 13:07:30 +0100
committerAl Viro <viro@zeniv.linux.org.uk>2011-01-17 02:25:30 -0500
commit64c23e86873ee410554d6d1c76b60da47025e96f (patch)
treeb30c5ff8782ebfdec6956d7834f796731fd3a1d4 /fs/ocfs2
parenteb745dbccce56f1bbe3f80b95ad2a325145171c2 (diff)
downloadkernel_samsung_crespo-64c23e86873ee410554d6d1c76b60da47025e96f.zip
kernel_samsung_crespo-64c23e86873ee410554d6d1c76b60da47025e96f.tar.gz
kernel_samsung_crespo-64c23e86873ee410554d6d1c76b60da47025e96f.tar.bz2
make the feature checks in ->fallocate future proof
Instead of various home grown checks that might need updates for new flags just check for any bit outside the mask of the features supported by the filesystem. This makes the check future proof for any newly added flag. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/ocfs2')
-rw-r--r--fs/ocfs2/file.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c
index 63e3fca..cf254ce 100644
--- a/fs/ocfs2/file.c
+++ b/fs/ocfs2/file.c
@@ -1997,6 +1997,8 @@ static long ocfs2_fallocate(struct inode *inode, int mode, loff_t offset,
int change_size = 1;
int cmd = OCFS2_IOC_RESVSP64;
+ if (mode & ~(FALLOC_FL_KEEP_SIZE | FALLOC_FL_PUNCH_HOLE))
+ return -EOPNOTSUPP;
if (!ocfs2_writes_unwritten_extents(osb))
return -EOPNOTSUPP;