diff --git a/mm/shmem.c b/mm/shmem.c index 9f70e02111c6a..a2801ba8ae2d1 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -1728,6 +1728,9 @@ static long shmem_fallocate(struct file *file, int mode, loff_t offset, pgoff_t start, index, end; int error; + if (mode & ~(FALLOC_FL_KEEP_SIZE | FALLOC_FL_PUNCH_HOLE)) + return -EOPNOTSUPP; + mutex_lock(&inode->i_mutex); if (mode & FALLOC_FL_PUNCH_HOLE) {