From mboxrd@z Thu Jan 1 00:00:00 1970 From: Herbert Poetzl Subject: Re: [RFC][PATCH 19/27] sys_faccessat() elevate writer count Date: Thu, 8 Jun 2006 13:03:23 +0200 Message-ID: <20060608110323.GI11996@MAIL.13thfloor.at> References: <20060608001013.0D041507@localhost.localdomain> <20060608001029.80D57052@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]:43994 "EHLO mail.13thfloor.at") by vger.kernel.org with ESMTP id S964824AbWFHLDY (ORCPT ); Thu, 8 Jun 2006 07:03:24 -0400 To: Dave Hansen Content-Disposition: inline In-Reply-To: <20060608001029.80D57052@localhost.localdomain> Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Wed, Jun 07, 2006 at 05:10:29PM -0700, Dave Hansen wrote: this is the first non-trivial change to the condition checks (regarding goto out_path_release) why didn't you break that out too? best, Herbert > Signed-off-by: Dave Hansen > --- > > lxc-dave/fs/open.c | 16 ++++++++++++++-- > 1 files changed, 14 insertions(+), 2 deletions(-) > > diff -puN fs/open.c~elevate-writers-opens-part2-sys_faccessat2 fs/open.c > --- lxc/fs/open.c~elevate-writers-opens-part2-sys_faccessat2 2006-06-07 16:53:23.000000000 -0700 > +++ lxc-dave/fs/open.c 2006-06-07 16:53:23.000000000 -0700 > @@ -542,9 +542,21 @@ asmlinkage long sys_faccessat(int dfd, c > > res = vfs_permission(&nd, mode); > /* SuS v2 requires we report a read only fs too */ > - if(!res && (mode & S_IWOTH) && IS_RDONLY(nd.dentry->d_inode) > - && !special_file(nd.dentry->d_inode->i_mode)) > + if(res) > + goto out_path_release; > + if (!(mode & S_IWOTH)) > + goto out_path_release; > + if (special_file(nd.dentry->d_inode->i_mode)) > + goto out_path_release; > + > + res = mnt_want_write(nd.mnt); > + if (res) { > + mnt_drop_write(nd.mnt); > + goto out_path_release; > + } > + if (IS_RDONLY(nd.dentry->d_inode)) > res = -EROFS; > +out_path_release: > path_release(&nd); > > out: > _