NFS: Fix dentry verifier races
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Wed, 29 Sep 2021 12:12:53 +0000 (08:12 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 18 Nov 2021 18:17:00 +0000 (19:17 +0100)
commit6967d9967b7a37cdd2f2e83def026e34e2c6a51a
treeb765c4bc43df3db689af8e94f97b4b136a1de518
parent597e9c7a4acebcdc29bf87e6672ad8e256beb2f4
NFS: Fix dentry verifier races

[ Upstream commit cec08f452a687fce9dfdf47946d00a1d12a8bec5 ]

If the directory changed while we were revalidating the dentry, then
don't update the dentry verifier. There is no value in setting the
verifier to an older value, and we could end up overwriting a more up to
date verifier from a parallel revalidation.

Fixes: efeda80da38d ("NFSv4: Fix revalidation of dentries with delegations")
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Tested-by: Benjamin Coddington <bcodding@redhat.com>
Reviewed-by: Benjamin Coddington <bcodding@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/nfs/dir.c