* [PATCH] [RFC] vfs: don't revalidate dentries that serve as mountpoints @ 2013-11-05 1:16 ` Jeff Layton 0 siblings, 0 replies; 10+ messages in thread From: Jeff Layton @ 2013-11-05 1:16 UTC (permalink / raw) To: viro; +Cc: linux-fsdevel, linux-nfs, linux-kernel, chutzpah, liguangc 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); } -- 1.8.3.1 ^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH] [RFC] vfs: don't revalidate dentries that serve as mountpoints @ 2013-11-05 1:16 ` Jeff Layton 0 siblings, 0 replies; 10+ messages in thread From: Jeff Layton @ 2013-11-05 1:16 UTC (permalink / raw) To: viro-3bDd1+5oDREiFSDQTTA3OLVCufUGDwFn Cc: linux-fsdevel-u79uwXL29TY76Z2rM5mHXA, linux-nfs-u79uwXL29TY76Z2rM5mHXA, linux-kernel-u79uwXL29TY76Z2rM5mHXA, chutzpah-aBrp7R+bbdUdnm+yROfE0A, liguangc-vtt25B2cwJLQT0dZR+AlfA 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); } -- 1.8.3.1 -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH] [RFC] vfs: don't revalidate dentries that serve as mountpoints @ 2013-11-05 2:39 ` NeilBrown 0 siblings, 0 replies; 10+ messages in thread From: NeilBrown @ 2013-11-05 2:39 UTC (permalink / raw) To: Jeff Layton Cc: viro, linux-fsdevel, linux-nfs, linux-kernel, chutzpah, liguangc [-- Attachment #1: Type: text/plain, Size: 1518 bytes --] 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 [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 828 bytes --] ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] [RFC] vfs: don't revalidate dentries that serve as mountpoints @ 2013-11-05 2:39 ` NeilBrown 0 siblings, 0 replies; 10+ messages in thread From: NeilBrown @ 2013-11-05 2:39 UTC (permalink / raw) To: Jeff Layton Cc: viro-3bDd1+5oDREiFSDQTTA3OLVCufUGDwFn, linux-fsdevel-u79uwXL29TY76Z2rM5mHXA, linux-nfs-u79uwXL29TY76Z2rM5mHXA, linux-kernel-u79uwXL29TY76Z2rM5mHXA, chutzpah-aBrp7R+bbdUdnm+yROfE0A, liguangc-vtt25B2cwJLQT0dZR+AlfA [-- 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 --] ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] [RFC] vfs: don't revalidate dentries that serve as mountpoints 2013-11-05 2:39 ` NeilBrown (?) @ 2013-11-05 10:34 ` Jeff Layton -1 siblings, 0 replies; 10+ messages in thread From: Jeff Layton @ 2013-11-05 10:34 UTC (permalink / raw) To: NeilBrown Cc: viro, linux-fsdevel, linux-nfs, linux-kernel, chutzpah, liguangc [-- 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 --] ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] [RFC] vfs: don't revalidate dentries that serve as mountpoints @ 2013-11-05 3:00 ` Shirish Pargaonkar 0 siblings, 0 replies; 10+ messages in thread From: Shirish Pargaonkar @ 2013-11-05 3:00 UTC (permalink / raw) To: Jeff Layton; +Cc: viro, linux-fsdevel, linux-nfs, LKML, chutzpah, liguangc For a similar issue in cifs vfs (samba bugzilla 8950), I was going to try unset the bit DCACHE_OP_REVALIDATE of d_flags of the dentry. Would something like work for the mountpoint dentry? On Mon, Nov 4, 2013 at 7:16 PM, 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); > } > > -- > 1.8.3.1 > > -- > To unsubscribe from this list: send the line "unsubscribe linux-nfs" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] [RFC] vfs: don't revalidate dentries that serve as mountpoints @ 2013-11-05 3:00 ` Shirish Pargaonkar 0 siblings, 0 replies; 10+ messages in thread From: Shirish Pargaonkar @ 2013-11-05 3:00 UTC (permalink / raw) To: Jeff Layton Cc: viro-RmSDqhL/yNMiFSDQTTA3OLVCufUGDwFn, linux-fsdevel, linux-nfs-u79uwXL29TY76Z2rM5mHXA, LKML, chutzpah-aBrp7R+bbdUdnm+yROfE0A, liguangc-vtt25B2cwJLQT0dZR+AlfA For a similar issue in cifs vfs (samba bugzilla 8950), I was going to try unset the bit DCACHE_OP_REVALIDATE of d_flags of the dentry. Would something like work for the mountpoint dentry? On Mon, Nov 4, 2013 at 7:16 PM, 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); > } > > -- > 1.8.3.1 > > -- > To unsubscribe from this list: send the line "unsubscribe linux-nfs" in > the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org > More majordomo info at http://vger.kernel.org/majordomo-info.html -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] [RFC] vfs: don't revalidate dentries that serve as mountpoints @ 2013-11-05 8:28 ` Christoph Hellwig 0 siblings, 0 replies; 10+ messages in thread From: Christoph Hellwig @ 2013-11-05 8:28 UTC (permalink / raw) To: Shirish Pargaonkar Cc: Jeff Layton, viro, linux-fsdevel, linux-nfs, LKML, chutzpah, liguangc On Mon, Nov 04, 2013 at 09:00:23PM -0600, Shirish Pargaonkar wrote: > For a similar issue in cifs vfs (samba bugzilla 8950), I was going to try > unset the bit DCACHE_OP_REVALIDATE of d_flags of the > dentry. Would something like work for the mountpoint dentry? The DCACHE_OP_REVALIDATE are just caches of the available dentry operations, please don't manipulate those flags on their own. ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] [RFC] vfs: don't revalidate dentries that serve as mountpoints @ 2013-11-05 8:28 ` Christoph Hellwig 0 siblings, 0 replies; 10+ messages in thread From: Christoph Hellwig @ 2013-11-05 8:28 UTC (permalink / raw) To: Shirish Pargaonkar Cc: Jeff Layton, viro-RmSDqhL/yNMiFSDQTTA3OLVCufUGDwFn, linux-fsdevel, linux-nfs-u79uwXL29TY76Z2rM5mHXA, LKML, chutzpah-aBrp7R+bbdUdnm+yROfE0A, liguangc-vtt25B2cwJLQT0dZR+AlfA On Mon, Nov 04, 2013 at 09:00:23PM -0600, Shirish Pargaonkar wrote: > For a similar issue in cifs vfs (samba bugzilla 8950), I was going to try > unset the bit DCACHE_OP_REVALIDATE of d_flags of the > dentry. Would something like work for the mountpoint dentry? The DCACHE_OP_REVALIDATE are just caches of the available dentry operations, please don't manipulate those flags on their own. -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] [RFC] vfs: don't revalidate dentries that serve as mountpoints 2013-11-05 3:00 ` Shirish Pargaonkar (?) (?) @ 2013-11-05 10:42 ` Jeff Layton -1 siblings, 0 replies; 10+ messages in thread From: Jeff Layton @ 2013-11-05 10:42 UTC (permalink / raw) To: Shirish Pargaonkar Cc: viro, linux-fsdevel, linux-nfs, LKML, chutzpah, liguangc On Mon, 4 Nov 2013 21:00:23 -0600 Shirish Pargaonkar <shirishpargaonkar@gmail.com> wrote: > For a similar issue in cifs vfs (samba bugzilla 8950), I was going to try > unset the bit DCACHE_OP_REVALIDATE of d_flags of the > dentry. Would something like work for the mountpoint dentry? > > I don't think that's the same issue at all. The problem there is that you need to instantiate a dentry for the root of the mount on the client, when you don't have any information about the parents. In this case, we have dentries that are acting as mountpoints that were getting invalidated. > > On Mon, Nov 4, 2013 at 7:16 PM, 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); > > } > > > > -- > > 1.8.3.1 > > > > -- > > To unsubscribe from this list: send the line "unsubscribe linux-nfs" in > > the body of a message to majordomo@vger.kernel.org > > More majordomo info at http://vger.kernel.org/majordomo-info.html -- Jeff Layton <jlayton@redhat.com> ^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2013-11-05 10:43 UTC | newest] Thread overview: 10+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2013-11-05 1:16 [PATCH] [RFC] vfs: don't revalidate dentries that serve as mountpoints Jeff Layton 2013-11-05 1:16 ` Jeff Layton 2013-11-05 2:39 ` NeilBrown 2013-11-05 2:39 ` NeilBrown 2013-11-05 10:34 ` Jeff Layton 2013-11-05 3:00 ` Shirish Pargaonkar 2013-11-05 3:00 ` Shirish Pargaonkar 2013-11-05 8:28 ` Christoph Hellwig 2013-11-05 8:28 ` Christoph Hellwig 2013-11-05 10:42 ` Jeff Layton
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.