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>
diff --git a/fs/fuse/file.c b/fs/fuse/file.c
index 13f8bde..982288a 100644
--- a/fs/fuse/file.c
+++ b/fs/fuse/file.c
@@ -2972,6 +2972,9 @@
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;