NFSv4: Fix races between open and dentry revalidation
authorTrond Myklebust <trondmy@gmail.com>
Wed, 5 Feb 2020 14:01:53 +0000 (09:01 -0500)
committerAnna Schumaker <Anna.Schumaker@Netapp.com>
Mon, 10 Feb 2020 15:50:59 +0000 (10:50 -0500)
commitcf5b4059ba7197d6cef9c0e024979d178ed8c8ec
treed9ec3c8699f049af43388d671dde214138ed67df
parenta1147b8281bda99bda99892233e1900329a9cbf1
NFSv4: Fix races between open and dentry revalidation

We want to make sure that we revalidate the dentry if and only if
we've done an OPEN by filename.
In order to avoid races with remote changes to the directory on the
server, we want to save the verifier before calling OPEN. The exception
is if the server returned a delegation with our OPEN, as we then
know that the filename can't have changed on the server.

Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Reviewed-by: Benjamin Coddington <bcodding@gmail.com>
Tested-by: Benjamin Coddington <bcodding@gmail.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
fs/nfs/nfs4file.c
fs/nfs/nfs4proc.c