mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jeff Layton <jlayton@redhat.com>
To: NeilBrown <neilb@suse.de>
Cc: viro@ZenIV.linux.org.uk, linux-fsdevel@vger.kernel.org,
	linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org,
	chutzpah@gentoo.org, liguangc@cn.ibm.com
Subject: Re: [PATCH] [RFC] vfs: don't revalidate dentries that serve as mountpoints
Date: Tue, 5 Nov 2013 05:34:48 -0500	[thread overview]
Message-ID: <20131105053448.57ab7f0e@tlielax.poochiereds.net> (raw)
In-Reply-To: <20131105133959.5be7c728@notabene.brown>

[-- Attachment #1: Type: text/plain, Size: 2117 bytes --]

On Tue, 5 Nov 2013 13:39:59 +1100
NeilBrown <neilb@suse.de> wrote:

> On Mon,  4 Nov 2013 20:16:26 -0500 Jeff Layton <jlayton@redhat.com> wrote:
> 
> > We had a couple of reports of people that are mounting NFS filesystems,
> > and then bind mounting certain local files onto dentries in that nfs
> > mount (sort of like a poor-man's unionmount).
> > 
> > This all works well until the dentry serving as the mountpoint fails
> > d_revalidate. The dentry will end up being invalidated which makes the
> > bind mount unreachable via pathwalk.
> > 
> > It doesn't make much sense to me to allow dentries to serve as
> > mountpoints to end up invalidated, so there's no real point in
> > attempting to d_revalidate them at all.
> > 
> > Reported-by: Patrick McLean <chutzpah@gentoo.org>
> > Reported-by: Guang Cheng Li <liguangc@cn.ibm.com>
> > Signed-off-by: Jeff Layton <jlayton@redhat.com>
> > ---
> >  fs/namei.c | 3 +++
> >  1 file changed, 3 insertions(+)
> > 
> > diff --git a/fs/namei.c b/fs/namei.c
> > index caa2805..5b10ad0 100644
> > --- a/fs/namei.c
> > +++ b/fs/namei.c
> > @@ -585,6 +585,9 @@ drop_root_mnt:
> >  
> >  static inline int d_revalidate(struct dentry *dentry, unsigned int flags)
> >  {
> > +	/* dentries that serve as mountpoints are always considered valid */
> > +	if (d_mountpoint(dentry))
> > +		return 1;
> >  	return dentry->d_op->d_revalidate(dentry, flags);
> >  }
> >  
> 
> Makes sense to me. But what about the parent or grandparent of the mountpoint?
> 
> Presumably we don't want to invalidate them either, and I don't think
> d_mountpoint() returns true for those, does it?
> 
> NeilBrown

Good point...

I think we're probably saved there (at least on NFS) by the
check_submounts_and_drop() call in nfs_lookup_revalidate.

Hmmm, that said...I did do most of this testing on a slightly older
kernel that doesn't have that call, and I can't reproduce this problem
on a 3.12-ish kernel. I think this is probably already fixed by Miklos'
patches that added that.

Sorry for the noise!
-- 
Jeff Layton <jlayton@redhat.com>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

  reply	other threads:[~2013-11-05 10:35 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-05  1:16 Jeff Layton
2013-11-05  2:39 ` NeilBrown
2013-11-05 10:34   ` Jeff Layton [this message]
2013-11-05  3:00 ` Shirish Pargaonkar
2013-11-05  8:28   ` Christoph Hellwig
2013-11-05 10:42   ` 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=20131105053448.57ab7f0e@tlielax.poochiereds.net \
    --to=jlayton@redhat.com \
    --cc=chutzpah@gentoo.org \
    --cc=liguangc@cn.ibm.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=neilb@suse.de \
    --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

all inboxes | Powered by JetHome®