From mboxrd@z Thu Jan 1 00:00:00 1970 From: NeilBrown Subject: Re: [PATCH] [RFC] vfs: don't revalidate dentries that serve as mountpoints Date: Tue, 5 Nov 2013 13:39:59 +1100 Message-ID: <20131105133959.5be7c728@notabene.brown> References: <1383614186-8039-1-git-send-email-jlayton@redhat.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=PGP-SHA1; boundary="Sig_/ohWK6fgkFxnbDM6JDmMBcxR"; protocol="application/pgp-signature" 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 To: Jeff Layton Return-path: In-Reply-To: <1383614186-8039-1-git-send-email-jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> Sender: linux-nfs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: linux-fsdevel.vger.kernel.org --Sig_/ohWK6fgkFxnbDM6JDmMBcxR Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Mon, 4 Nov 2013 20:16:26 -0500 Jeff Layton 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). >=20 > 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. >=20 > 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. >=20 > Reported-by: Patrick McLean > Reported-by: Guang Cheng Li > Signed-off-by: Jeff Layton > --- > fs/namei.c | 3 +++ > 1 file changed, 3 insertions(+) >=20 > 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: > =20 > 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); > } > =20 Makes sense to me. But what about the parent or grandparent of the mountpoi= nt? Presumably we don't want to invalidate them either, and I don't think d_mountpoint() returns true for those, does it? NeilBrown --Sig_/ohWK6fgkFxnbDM6JDmMBcxR Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (GNU/Linux) iQIVAwUBUnhafznsnt1WYoG5AQI/fg/+I44pFQXLRzZ9X9fKgnECyiFpE08OfiWX B0GQzqYe7OyzH7aLDus53eEC+8NVqt05VpVMzdQalAT00fTEp//87VHV9FYBsxag bHJlbeTC0s1MSGf8FfDtODpkPalJtArHZIXXCeK/a8e9fTQJD7Uqo0WQcmli0toj HLfFwX+C1OiU2I/AHTDzflfpmEEYfl1a6+NKryb//RpHh+oe47FhK5CtLgzSHPba Q5zHph5xf2eJ7/An3BJDM794PK53ixArfoPLnf460PGJ2n5Zj/9pbgGq1QDcQZS2 /LoAj7yj9tAGZrVrdn6Vdx0Lg1o+QcidTs2EMA7n7cSMCpau1hisRQyqEG/BCOFa sh5L6tv9SgtXXLhf1cD0oqo3juLS/AomDhAjj5bqUwPfskVCyemObJGE3uWt90+8 fE4jBEl2Qkpl9tDS5Lb/v0tSsqLm+7shvR5gb/Em3PrM2L60grc6DiRryEoPrMef Ui5S4MN9eYsLlg4lAqD2hKI0txOoeT6SKpt1xPk8dMju3FYyDX8sFD3rr98PeNc3 CHyoHAknl9jH9xIy7kvFVU40eEj2Dmb8v6nUWpj2pANjzWdkVeGDzo4A+LLYyVsF H4MxD9NNBMKgVjZPpYzBxnNJNvuWDdLbjZ987Vd3x5ZMTNlD0V6i98DjVmhV+LZp /KxdGwW5p9I= =0pVE -----END PGP SIGNATURE----- --Sig_/ohWK6fgkFxnbDM6JDmMBcxR-- -- 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