From: Christoph Hellwig <hch@lst.de>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Al Viro <viro@ZenIV.linux.org.uk>, Christoph Hellwig <hch@lst.de>,
linux-fsdevel <linux-fsdevel@vger.kernel.org>
Subject: Re: [PATCH 1/2] VFS: Cut down inode->i_op->xyz accesses in path walking
Date: Fri, 22 Jul 2011 19:47:19 +0200 [thread overview]
Message-ID: <20110722174719.GB26076@lst.de> (raw)
In-Reply-To: <alpine.LFD.2.02.1107221037200.29055@i5.linux-foundation.org>
On Fri, Jul 22, 2011 at 10:37:58AM -0700, Linus Torvalds wrote:
> + if (unlikely(inode->i_op->lookup))
> + dentry->d_flags |= DCACHE_OP_LOOKUP;
Would simply adding an S_ISDIR check first help the same without adding
another flag?
> + if (unlikely(inode->i_op->permission))
> + dentry->d_flags |= DCACHE_OP_PERMISSION;
> + if (unlikely(inode->i_op->follow_link))
> + dentry->d_flags |= DCACHE_OP_FOLLOW_LINK;
Now that the follow_link abuse for automoun is gone I wonder if we really
need to keep supporting it on anything but links. If not we could
avoid the additional flag by simply checking of S_ISLNK first.
We can also add new dentry to inode pointers without going through
__d_instanciate in d_obtain_alias, so that case also needs to set your
flags.
> diff --git a/fs/namei.c b/fs/namei.c
> index 14ab8d3f2f0c..02b680e0e816 100644
> --- a/fs/namei.c
> +++ b/fs/namei.c
> @@ -577,12 +577,12 @@ static int complete_walk(struct nameidata *nd)
> * short-cut DAC fails, then call ->permission() to do more
> * complete permission check.
> */
> -static inline int exec_permission(struct inode *inode, unsigned int flags)
> +static inline int exec_permission(struct dentry *dentry, struct inode *inode, unsigned int flags)
> {
> int ret;
> struct user_namespace *ns = inode_userns(inode);
>
> - if (inode->i_op->permission) {
> + if (dentry->d_flags & DCACHE_OP_PERMISSION) {
> ret = inode->i_op->permission(inode, MAY_EXEC, flags);
> } else {
The permission bits clash with Al changes in that area, including the
removal of exec_permission and the ->permission prototype change.
I think you should rebase ontop of his for-next tree.
next prev parent reply other threads:[~2011-07-22 17:47 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-22 17:37 VFS pathname walking cleanups (i_op and ACL access) Linus Torvalds
2011-07-22 17:37 ` [PATCH 1/2] VFS: Cut down inode->i_op->xyz accesses in path walking Linus Torvalds
2011-07-22 17:47 ` Christoph Hellwig [this message]
2011-07-22 23:40 ` Al Viro
2011-07-22 23:54 ` Linus Torvalds
2011-07-23 3:55 ` [PATCH] " Linus Torvalds
2011-07-23 13:35 ` Christoph Hellwig
2011-07-23 14:46 ` Al Viro
2011-07-23 14:51 ` Christoph Hellwig
2011-07-23 15:45 ` Linus Torvalds
[not found] ` <alpine.LFD.2.02.1107251852220.13796@i5.linux-foundation.org>
2011-07-26 3:05 ` Al Viro
2011-07-26 3:23 ` Linus Torvalds
2011-07-26 18:41 ` Al Viro
2011-07-26 18:45 ` Linus Torvalds
2011-08-07 6:06 ` Linus Torvalds
2011-08-07 6:51 ` Al Viro
2011-08-07 23:43 ` Linus Torvalds
2011-07-22 17:40 ` VFS pathname walking cleanups (i_op and ACL access) Christoph Hellwig
2011-07-22 17:45 ` [PATCH 2/2] vfs: move ACL cache lookup into generic code Linus Torvalds
2011-07-22 17:50 ` Christoph Hellwig
2011-07-22 17:54 ` Linus Torvalds
2011-07-23 2:34 ` [PATCH] " Linus Torvalds
2011-07-23 3:29 ` Al Viro
2011-07-23 3:42 ` Linus Torvalds
2011-07-23 4:31 ` Al Viro
2011-07-23 6:06 ` Al Viro
2011-07-25 8:15 ` Aneesh Kumar K.V
2011-07-25 8:16 ` Aneesh Kumar K.V
2011-07-23 7:47 ` Al Viro
2011-07-23 14:50 ` Christoph Hellwig
2011-07-23 15:32 ` Al Viro
2011-07-23 17:02 ` Al Viro
2011-07-23 17:31 ` Linus Torvalds
2011-07-23 18:20 ` Al Viro
2011-07-23 18:29 ` Linus Torvalds
2011-07-23 21:53 ` Al Viro
2011-07-23 22:38 ` Al Viro
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=20110722174719.GB26076@lst.de \
--to=hch@lst.de \
--cc=linux-fsdevel@vger.kernel.org \
--cc=torvalds@linux-foundation.org \
--cc=viro@ZenIV.linux.org.uk \
/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).