linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: NeilBrown <neilb-l3A5Bk7waGM@public.gmane.org>
To: Jeff Layton <jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Cc: viro-3bDd1+5oDREiFSDQTTA3OLVCufUGDwFn@public.gmane.org,
	linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-nfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	chutzpah-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org,
	liguangc-vtt25B2cwJLQT0dZR+AlfA@public.gmane.org
Subject: Re: [PATCH] [RFC] vfs: don't revalidate dentries that serve as mountpoints
Date: Tue, 5 Nov 2013 13:39:59 +1100	[thread overview]
Message-ID: <20131105133959.5be7c728@notabene.brown> (raw)
In-Reply-To: <1383614186-8039-1-git-send-email-jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>

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

On Mon,  4 Nov 2013 20:16:26 -0500 Jeff Layton <jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> 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-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org>
> Reported-by: Guang Cheng Li <liguangc-vtt25B2cwJLQT0dZR+AlfA@public.gmane.org>
> Signed-off-by: Jeff Layton <jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
> ---
>  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

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

  parent reply	other threads:[~2013-11-05  2:39 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-05  1:16 [PATCH] [RFC] vfs: don't revalidate dentries that serve as mountpoints Jeff Layton
     [not found] ` <1383614186-8039-1-git-send-email-jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2013-11-05  2:39   ` NeilBrown [this message]
2013-11-05 10:34     ` Jeff Layton
2013-11-05  3:00   ` Shirish Pargaonkar
     [not found]     ` <CADT32eJ_cqej0wnjKOZk1x0UtRqoNy201hFt8hQLLShjcbp3Dg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
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=20131105133959.5be7c728@notabene.brown \
    --to=neilb-l3a5bk7wagm@public.gmane.org \
    --cc=chutzpah-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org \
    --cc=jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=liguangc-vtt25B2cwJLQT0dZR+AlfA@public.gmane.org \
    --cc=linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-nfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=viro-3bDd1+5oDREiFSDQTTA3OLVCufUGDwFn@public.gmane.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;
as well as URLs for NNTP newsgroup(s).