diff options
author | Miklos Szeredi <mszeredi@redhat.com> | 2019-05-27 12:42:07 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-06-11 13:21:48 +0300 |
commit | 7a28b74256417017ba576979e315a39313f832d3 (patch) | |
tree | 70637ddf431ab1f46df05fb08e11bdb8fa429405 /fs | |
parent | 91f4595129915406ad2ecbc6bd2591cdf0ce5f8b (diff) | |
download | linux-7a28b74256417017ba576979e315a39313f832d3.tar.xz |
fuse: fallocate: fix return with locked inode
commit 35d6fcbb7c3e296a52136347346a698a35af3fda upstream.
Do the proper cleanup in case the size check fails.
Tested with xfstests:generic/228
Reported-by: kbuild test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Fixes: 0cbade024ba5 ("fuse: honor RLIMIT_FSIZE in fuse_file_fallocate")
Cc: Liu Bo <bo.liu@linux.alibaba.com>
Cc: <stable@vger.kernel.org> # v3.5
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/fuse/file.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/fuse/file.c b/fs/fuse/file.c index 7882fc34113c..011065262aed 100644 --- a/fs/fuse/file.c +++ b/fs/fuse/file.c @@ -2978,7 +2978,7 @@ static long fuse_file_fallocate(struct file *file, int mode, loff_t offset, offset + length > i_size_read(inode)) { err = inode_newsize_ok(inode, offset + length); if (err) - return err; + goto out; } if (!(mode & FALLOC_FL_KEEP_SIZE)) |