]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
NFS: Don't invalidate a submounted dentry in nfs_prime_dcache()
authorTrond Myklebust <trond.myklebust@primarydata.com>
Sun, 22 Feb 2015 21:35:36 +0000 (16:35 -0500)
committerSasha Levin <sasha.levin@oracle.com>
Tue, 24 Mar 2015 01:02:51 +0000 (21:02 -0400)
commit6394d0e510ce8d1de980fe2641f81ac84f3166cc
tree94d5b3b0f6b9657ae6a9c742b3d31e0fb9753e53
parent76e118b5f07d3e6a198e605f5665f92e74555230
NFS: Don't invalidate a submounted dentry in nfs_prime_dcache()

commit 6c441c254eea2354d686be7f5544bcd79fb6a61f upstream.

If we're traversing a directory which contains a submounted filesystem,
or one that has a referral, the NFS server that is processing the READDIR
request will often return information for the underlying (mounted-on)
directory. It may, or may not, also return filehandle information.

If this happens, and the lookup in nfs_prime_dcache() returns the
dentry for the submounted directory, the filehandle comparison will
fail, and we call d_invalidate(). Post-commit 8ed936b5671bf
("vfs: Lazily remove mounts on unlinked files and directories."), this
means the entire subtree is unmounted.

The following minimal patch addresses this problem by punting on
the invalidation if there is a submount.

Kudos to Neil Brown <neilb@suse.de> for having tracked down this
issue (see link).

Reported-by: Nix <nix@esperi.org.uk>
Link: http://lkml.kernel.org/r/87iofju9ht.fsf@spindle.srvr.nix
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/nfs/dir.c