]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
NFS: Label the dentry with a verifier in nfs_rmdir() and nfs_unlink()
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Thu, 8 Jul 2021 01:43:09 +0000 (21:43 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 19 Jan 2026 12:09:36 +0000 (13:09 +0100)
commit186072b7a23cae2a8b8a39a8d36aa7be645a480c
treed0aac2717abb3fa5a2404a0c00b295631f0d7147
parent5f1bc99ea83155e6428971e03503436ee1c44fba
NFS: Label the dentry with a verifier in nfs_rmdir() and nfs_unlink()

[ Upstream commit 9019fb391de02cbff422090768b73afe9f6174df ]

After the success of an operation such as rmdir() or unlink(), we expect
to add the dentry back to the dcache as an ordinary negative dentry.
However in NFS, unless it is labelled with the appropriate verifier for
the parent directory state, then nfs_lookup_revalidate will end up
discarding that dentry and forcing a new lookup.

The fix is to ensure that we relabel the dentry appropriately on
success.

Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Stable-dep-of: bd4928ec799b ("NFS: Avoid changing nlink when file removes and attribute updates race")
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/nfs/dir.c