Skip to content

Commit

Permalink
fuse: fallocate: fix return with locked inode
Browse files Browse the repository at this point in the history
Do the proper cleanup in case the size check fails.

Tested with xfstests:generic/228

Reported-by: kbuild test robot <[email protected]>
Reported-by: Dan Carpenter <[email protected]>
Fixes: 0cbade0 ("fuse: honor RLIMIT_FSIZE in fuse_file_fallocate")
Cc: Liu Bo <[email protected]>
Cc: <[email protected]> # v3.5
Signed-off-by: Miklos Szeredi <[email protected]>
  • Loading branch information
Miklos Szeredi committed May 27, 2019
1 parent cd6c84d commit 35d6fcb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/fuse/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -3055,7 +3055,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))
Expand Down

0 comments on commit 35d6fcb

Please sign in to comment.