]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
f2fs: remove extra inode_unlock() in error path
authorLuis Henriques <lhenriques@suse.com>
Tue, 11 Jul 2017 16:30:33 +0000 (17:30 +0100)
committerJaegeuk Kim <jaegeuk@kernel.org>
Sun, 16 Jul 2017 04:10:23 +0000 (21:10 -0700)
This commit removes an extra inode_unlock() that is being done in function
f2fs_ioc_setflags error path.  While there, get rid of a useless 'out'
label as well.

Fixes: 0abd675e97e6 ("f2fs: support plain user/group quota")
Signed-off-by: Luis Henriques <lhenriques@suse.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/file.c

index a0e6d2c65a9ec013ed05a6a67ced7ca6995e9842..2706130c261b060f46cb526b8e7ac501789808a7 100644 (file)
@@ -1538,7 +1538,6 @@ static int f2fs_ioc_setflags(struct file *filp, unsigned long arg)
 
        /* Is it quota file? Do not allow user to mess with it */
        if (IS_NOQUOTA(inode)) {
-               inode_unlock(inode);
                ret = -EPERM;
                goto unlock_out;
        }
@@ -1549,9 +1548,8 @@ static int f2fs_ioc_setflags(struct file *filp, unsigned long arg)
 
        if ((flags ^ oldflags) & (FS_APPEND_FL | FS_IMMUTABLE_FL)) {
                if (!capable(CAP_LINUX_IMMUTABLE)) {
-                       inode_unlock(inode);
                        ret = -EPERM;
-                       goto out;
+                       goto unlock_out;
                }
        }
 
@@ -1564,7 +1562,6 @@ static int f2fs_ioc_setflags(struct file *filp, unsigned long arg)
        f2fs_mark_inode_dirty_sync(inode, false);
 unlock_out:
        inode_unlock(inode);
-out:
        mnt_drop_write_file(filp);
        return ret;
 }