diff --git a/fs/fuse/file.c b/fs/fuse/file.c index 0ada6e91cc38eb50b1a79138b1f4d8b6e64bc19d..21fd510183c3db666c83e3dd787f3215f93de3a3 100644 --- a/fs/fuse/file.c +++ b/fs/fuse/file.c @@ -2975,6 +2975,13 @@ static long fuse_file_fallocate(struct file *file, int mode, loff_t offset, } } + if (!(mode & FALLOC_FL_KEEP_SIZE) && + offset + length > i_size_read(inode)) { + err = inode_newsize_ok(inode, offset + length); + if (err) + return err; + } + if (!(mode & FALLOC_FL_KEEP_SIZE)) set_bit(FUSE_I_SIZE_UNSTABLE, &fi->state);