summaryrefslogtreecommitdiffstats
path: root/fs/fuse
diff options
context:
space:
mode:
authorMiklos Szeredi <mszeredi@suse.cz>2014-04-28 14:19:21 +0200
committerMiklos Szeredi <mszeredi@suse.cz>2014-04-28 14:19:21 +0200
commit4adb83029de8ef5144a14dbb5c21de0f156c1a03 (patch)
tree83e0792be0d1d9271dbe7384db23ea426d0a7320 /fs/fuse
parent7736e8cc51bbfdbd538c1870c314eb3483fe04ed (diff)
downloadlinux-stable-4adb83029de8ef5144a14dbb5c21de0f156c1a03.tar.gz
linux-stable-4adb83029de8ef5144a14dbb5c21de0f156c1a03.tar.bz2
linux-stable-4adb83029de8ef5144a14dbb5c21de0f156c1a03.zip
fuse: check fallocate mode
Don't allow new fallocate modes until we figure out what (if anything) that takes. Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Diffstat (limited to 'fs/fuse')
-rw-r--r--fs/fuse/file.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/fuse/file.c b/fs/fuse/file.c
index 13f8bdec5110..982288a1c6ab 100644
--- a/fs/fuse/file.c
+++ b/fs/fuse/file.c
@@ -2972,6 +2972,9 @@ static long fuse_file_fallocate(struct file *file, int mode, loff_t offset,
bool lock_inode = !(mode & FALLOC_FL_KEEP_SIZE) ||
(mode & FALLOC_FL_PUNCH_HOLE);
+ if (mode & ~(FALLOC_FL_KEEP_SIZE | FALLOC_FL_PUNCH_HOLE))
+ return -EOPNOTSUPP;
+
if (fc->no_fallocate)
return -EOPNOTSUPP;