From: ebiederm@xmission.com (Eric W. Biederman)
To: Miklos Szeredi <miklos@szeredi.hu>
Cc: jlayton@redhat.com, linux-fsdevel@vger.kernel.org,
linux-kernel@vger.kernel.org, jamie@shareable.org, pavel@ucw.cz,
viro@ZenIV.linux.org.uk, duaneg@dghda.com
Subject: Re: [PATCH 2/2] vfs: force reval on dentry of bind mounted files on FS_REVAL_DOT filesystems
Date: Thu, 03 Dec 2009 03:56:41 -0800 [thread overview]
Message-ID: <m18wdknudi.fsf@fess.ebiederm.org> (raw)
In-Reply-To: <E1NG9iu-0002jR-1r@pomaz-ex.szeredi.hu> (Miklos Szeredi's message of "Thu\, 03 Dec 2009 12\:19\:48 +0100")
Miklos Szeredi <miklos@szeredi.hu> writes:
> On Thu, 03 Dec 2009, Eric W. Biederman wrote:
>> > The only worry I have is that this adds an extra branch in a very hot
>> > codepath (do_lookup). An error can't be returned, as you note, and
>> > for bind mounted directories d_invalidate() will not succeed: the
>> > directory is busy, it's referenced by the mount.
>>
>> Not true. d_mountpoint is false, so d_invalidate can succeed.
>
> Have a look at the code. d_invalidate() doesn't check for a
> mountpoint, it checks the refcount. It needs to keep the directory
> dentry hashed if it's in any way reachable other than from the cache
> (file descriptor, cwd, mount, etc).
Ah. I thought you were thinking about the mandatory have_submounts()
check in dentry->d_op->d_revalidate().
I expect the generic d_invalidate will simply hit the:
spin_lock(&dcache_lock);
if (d_unhashed(dentry)) {
spin_unlock(&dcache_lock);
return 0;
}
After the distributed filesystem has called d_drop in
dentry->d_op->d_revalidate (when appropriate.
Eric
next prev parent reply other threads:[~2009-12-03 11:56 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-02 19:59 [PATCH 0/2] vfs: plug some holes involving LAST_BIND symlinks and file bind mounts (try #6) Jeff Layton
2009-12-02 19:59 ` [PATCH 1/2] vfs: force reval of target when following LAST_BIND symlinks Jeff Layton
2009-12-02 23:53 ` Eric W. Biederman
2009-12-03 10:39 ` Miklos Szeredi
2009-12-02 19:59 ` [PATCH 2/2] vfs: force reval on dentry of bind mounted files on FS_REVAL_DOT filesystems Jeff Layton
2009-12-03 0:01 ` Eric W. Biederman
2009-12-03 1:23 ` Jeff Layton
2009-12-03 10:58 ` Miklos Szeredi
2009-12-03 11:11 ` Eric W. Biederman
2009-12-03 11:19 ` Miklos Szeredi
2009-12-03 11:56 ` Eric W. Biederman [this message]
2009-12-03 15:21 ` Miklos Szeredi
2009-12-03 15:20 ` Jeff Layton
2009-12-03 18:35 ` Eric W. Biederman
2009-12-03 19:15 ` Jeff Layton
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=m18wdknudi.fsf@fess.ebiederm.org \
--to=ebiederm@xmission.com \
--cc=duaneg@dghda.com \
--cc=jamie@shareable.org \
--cc=jlayton@redhat.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=miklos@szeredi.hu \
--cc=pavel@ucw.cz \
--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 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.