Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755976AbdGLDBE (ORCPT ); Tue, 11 Jul 2017 23:01:04 -0400 Received: from mail.kernel.org ([198.145.29.99]:46472 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754769AbdGLDBD (ORCPT ); Tue, 11 Jul 2017 23:01:03 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 05BF622C88 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=chao@kernel.org Subject: Re: [f2fs-dev] [PATCH] f2fs: remove extra inode_unlock() in error path To: Luis Henriques , Jaegeuk Kim , Chao Yu Cc: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net References: <20170711163033.3700-1-lhenriques@suse.com> From: Chao Yu Message-ID: <3bae535f-8a82-5f50-954e-78d0f4ee4852@kernel.org> Date: Wed, 12 Jul 2017 11:00:50 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <20170711163033.3700-1-lhenriques@suse.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1806 Lines: 56 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 Reviewed-by: Chao Yu 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 >