linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
From: Chao Yu <chao@kernel.org>
To: Luis Henriques <lhenriques@suse.com>,
	Jaegeuk Kim <jaegeuk@kernel.org>, Chao Yu <yuchao0@huawei.com>
Cc: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [PATCH] f2fs: remove extra inode_unlock() in error path
Date: Wed, 12 Jul 2017 11:00:50 +0800	[thread overview]
Message-ID: <3bae535f-8a82-5f50-954e-78d0f4ee4852@kernel.org> (raw)
In-Reply-To: <20170711163033.3700-1-lhenriques@suse.com>

On 2017/7/12 0:30, Luis Henriques wrote:
> 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>

Thanks,

> ---
>  fs/f2fs/file.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
> index a0e6d2c65a9e..2706130c261b 100644
> --- a/fs/f2fs/file.c
> +++ b/fs/f2fs/file.c
> @@ -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;
>  }
> 
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Linux-f2fs-devel mailing list
> Linux-f2fs-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
> 

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot

      reply	other threads:[~2017-07-12  3:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-11 16:30 [PATCH] f2fs: remove extra inode_unlock() in error path Luis Henriques
2017-07-12  3:00 ` Chao Yu [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3bae535f-8a82-5f50-954e-78d0f4ee4852@kernel.org \
    --to=chao@kernel.org \
    --cc=jaegeuk@kernel.org \
    --cc=lhenriques@suse.com \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=yuchao0@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).