All of lore.kernel.org
 help / color / mirror / Atom feed
From: Al Viro <viro@ZenIV.linux.org.uk>
To: Christoph Hellwig <hch@lst.de>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	linux-fsdevel <linux-fsdevel@vger.kernel.org>
Subject: Re: [PATCH] VFS: Cut down inode->i_op->xyz accesses in path walking
Date: Sat, 23 Jul 2011 15:46:43 +0100	[thread overview]
Message-ID: <20110723144643.GE24703@ZenIV.linux.org.uk> (raw)
In-Reply-To: <20110723133534.GA8644@lst.de>

On Sat, Jul 23, 2011 at 03:35:34PM +0200, Christoph Hellwig wrote:
> On Fri, Jul 22, 2011 at 08:55:48PM -0700, Linus Torvalds wrote:
> > If something sets dentry->d_inode without going through __d_instantiate, 
> > that misses it. I'm looking at d_obtain_alias(), and wondering, for 
> > example.
> 
> As pointed out in my last mail d_obtain_alias will absolute need setting
> up these flags as well.

... and dentry_unlink_inode() - clearing them (note that we already are
clearing DCACHE_CANT_MOUNT there, so additional price will be trivial).

> I don't think we need to re-add exec_permission for it.  By checking
> DCACHE_OP_PERMISSION instead of inode->i_op->permission you'll always
> got directly to generic_permission in inode_permission, and in there
> acl_permission_check -> check_acl should simply do the right thing with
> your your patch to take the ACL cache checking into common code.

Checking DCACHE_OP_PERMISSION on _what_?  inode_permission() gets inode,
not dentry...  Now, we could mirror those into struct inode itself (and
that might make more sense, actually), but I'd rather not go through
the equivalent of d_set_d_op() patchset for i_op, with no hope for per-sb
defaults reducing the size of mess this time.  Calculating those flags
at __d_instantiate/d_obtain_alias still looks like the least painful
way to do it...

Come to think of that, reintroducing exec_permission() and making it
take dentry has a problem - we would be asking for trouble with the
"clean the flags" side of things.  If we race with e.g. rmdir(),
dentry *can* become negative under us on those calls.  Inode will
remain allocated and, with MAY_NOT_BLOCK, the actual ->permission()
will hopefully not rely on anything that might have been freed in
->evict_inode() (we do need to document and verify that, BTW), but
dentry flags could be cleared...

  reply	other threads:[~2011-07-23 14:46 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
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 [this message]
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=20110723144643.GE24703@ZenIV.linux.org.uk \
    --to=viro@zeniv.linux.org.uk \
    --cc=hch@lst.de \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=torvalds@linux-foundation.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.