From: Miklos Szeredi Date: Mon, 28 Apr 2014 12:19:21 +0000 (+0200) Subject: fuse: check fallocate mode X-Git-Tag: MMI-PSA29.97-13-9~12246^2~14 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=4adb83029de8ef5144a14dbb5c21de0f156c1a03;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git fuse: check fallocate mode Don't allow new fallocate modes until we figure out what (if anything) that takes. Signed-off-by: Miklos Szeredi --- 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;