From mboxrd@z Thu Jan 1 00:00:00 1970 From: Herbert Poetzl Subject: Re: [RFC][PATCH 08/27] sys_mkdirat(): one more goto Date: Thu, 8 Jun 2006 12:48:11 +0200 Message-ID: <20060608104811.GF11996@MAIL.13thfloor.at> References: <20060608001013.0D041507@localhost.localdomain> <20060608001020.25D272AD@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-fsdevel@vger.kernel.org, viro@ftp.linux.org.uk, hch@infradead.org, trond.myklebust@fys.uio.no Return-path: Received: from MAIL.13thfloor.at ([212.16.62.50]:32392 "EHLO mail.13thfloor.at") by vger.kernel.org with ESMTP id S964784AbWFHKsM (ORCPT ); Thu, 8 Jun 2006 06:48:12 -0400 To: Dave Hansen Content-Disposition: inline In-Reply-To: <20060608001020.25D272AD@localhost.localdomain> Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Wed, Jun 07, 2006 at 05:10:20PM -0700, Dave Hansen wrote: > > Add one more goto to collapse another if(). > > This should not cause any functional chagnes. Acked-by: Herbert Poetzl > Signed-off-by: Dave Hansen > --- > > lxc-dave/fs/namei.c | 14 ++++++++------ > 1 files changed, 8 insertions(+), 6 deletions(-) > > diff -puN fs/namei.c~sys_mkdir_at-move-cases-another-goto fs/namei.c > --- lxc/fs/namei.c~sys_mkdir_at-move-cases-another-goto 2006-06-07 16:53:16.000000000 -0700 > +++ lxc-dave/fs/namei.c 2006-06-07 16:53:16.000000000 -0700 > @@ -1901,12 +1901,14 @@ asmlinkage long sys_mkdirat(int dfd, con > goto out; > dentry = lookup_create(&nd, 1); > error = PTR_ERR(dentry); > - if (!IS_ERR(dentry)) { > - if (!IS_POSIXACL(nd.dentry->d_inode)) > - mode &= ~current->fs->umask; > - error = vfs_mkdir(nd.dentry->d_inode, dentry, mode); > - dput(dentry); > - } > + if (IS_ERR(dentry)) > + goto out_unlock; > + > + if (!IS_POSIXACL(nd.dentry->d_inode)) > + mode &= ~current->fs->umask; > + error = vfs_mkdir(nd.dentry->d_inode, dentry, mode); > + dput(dentry); > +out_unlock: > mutex_unlock(&nd.dentry->d_inode->i_mutex); > path_release(&nd); > out: > _