From: Dave Hansen <haveblue@us.ibm.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: akpm@osdl.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/6] prepare for write access checks: collapse if()
Date: Wed, 09 Aug 2006 10:18:08 -0700 [thread overview]
Message-ID: <1155143888.19249.154.camel@localhost.localdomain> (raw)
In-Reply-To: <20060809170904.GA7324@infradead.org>
On Wed, 2006-08-09 at 18:09 +0100, Christoph Hellwig wrote:
> On Wed, Aug 09, 2006 at 09:57:30AM -0700, Dave Hansen wrote:
> >
> > We're shortly going to be adding a bunch more permission
> > checks in these functions. That requires adding either a
> > bunch of new if() conditions, or some gotos. This patch
> > collapses existing if()s and uses gotos instead to
> > prepare for the upcoming changes.
> >
> > Signed-off-by: Dave Hansen <haveblue@us.ibm.com>
>
>
> Acked-by: Christoph Hellwig <hch@lst.de>
>
> > + res = vfs_permission(&nd, mode);
> > + /* SuS v2 requires we report a read only fs too */
> > + if(res || !(mode & S_IWOTH) ||
>
> except that there's a space missing after the if here :)
In my defense, the code I moved sucked, too. ;)
Signed-off-by: Dave Hansen <haveblue@us.ibm.com>
---
lxc-dave/fs/open.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff -puN fs/namei.c~B1-prepwork-collapse-ifs-spacefix fs/namei.c
diff -puN fs/open.c~B1-prepwork-collapse-ifs-spacefix fs/open.c
--- lxc/fs/open.c~B1-prepwork-collapse-ifs-spacefix 2006-08-09 10:13:18.000000000 -0700
+++ lxc-dave/fs/open.c 2006-08-09 10:14:12.000000000 -0700
@@ -525,11 +525,11 @@ 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) ||
+ if (res || !(mode & S_IWOTH) ||
special_file(nd.dentry->d_inode->i_mode))
goto out_path_release;
- if(IS_RDONLY(nd.dentry->d_inode))
+ if (IS_RDONLY(nd.dentry->d_inode))
res = -EROFS;
out_path_release:
_
-- Dave
next prev parent reply other threads:[~2006-08-09 17:18 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-08-09 16:57 [PATCH 0/6] read-only bind mount prep work Dave Hansen
2006-08-09 16:57 ` [PATCH 1/6] prepare for write access checks: collapse if() Dave Hansen
2006-08-09 17:09 ` Christoph Hellwig
2006-08-09 17:18 ` Dave Hansen [this message]
2006-08-09 16:57 ` [PATCH 2/6] r/o bind mount prepwork: move open_namei()'s vfs_create() Dave Hansen
2006-08-09 17:09 ` Christoph Hellwig
2006-08-09 16:57 ` [PATCH 4/6] r/o bind mount prepwork: inc_nlink() helper Dave Hansen
2006-08-09 17:11 ` Christoph Hellwig
2006-08-09 16:57 ` [PATCH 3/6] unlink: monitor i_nlink Dave Hansen
2006-08-09 17:11 ` Christoph Hellwig
2006-08-09 17:17 ` Dave Hansen
2006-08-09 18:27 ` Andrew Morton
2006-08-12 14:15 ` Arnd Bergmann
2006-08-09 16:57 ` [PATCH 5/6] clean up OCFS2 nlink handling Dave Hansen
2006-08-09 17:12 ` Christoph Hellwig
2006-08-09 19:15 ` Dave Hansen
2006-08-10 8:07 ` Steven Whitehouse
2006-08-10 19:06 ` Dave Hansen
2006-08-11 9:38 ` Steven Whitehouse
2006-08-09 16:57 ` [PATCH 6/6] monitor zeroing of i_nlink Dave Hansen
2006-08-09 17:14 ` Christoph Hellwig
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=1155143888.19249.154.camel@localhost.localdomain \
--to=haveblue@us.ibm.com \
--cc=akpm@osdl.org \
--cc=hch@infradead.org \
--cc=linux-kernel@vger.kernel.org \
/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