]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
fuse: fallocate: fix return with locked inode
authorMiklos Szeredi <mszeredi@redhat.com>
Mon, 27 May 2019 09:42:07 +0000 (11:42 +0200)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 14 Aug 2019 09:18:49 +0000 (11:18 +0200)
BugLink: https://bugs.launchpad.net/bugs/1838700
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>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
fs/fuse/file.c

index 94088b804f1ff4064cafe8423c8c4257f5dfd19b..e340449ca862f2931180be274c908da499e076dc 100644 (file)
@@ -2980,7 +2980,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))