OSDN Git Service

NFSv4: Handle NFS4ERR_OLD_STATEID in delegreturn
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Thu, 24 Oct 2019 22:00:35 +0000 (18:00 -0400)
committerTrond Myklebust <trond.myklebust@hammerspace.com>
Mon, 4 Nov 2019 02:28:46 +0000 (21:28 -0500)
commit246afc0aa5a7c66b081fbcab4d70ec379df3cb62
tree8b3e806511937a83a725c0ec9c29f83c47fa9f3c
parentee05f456772d4e3a04b539187473f50c394da5fa
NFSv4: Handle NFS4ERR_OLD_STATEID in delegreturn

If the server returns NFS4ERR_OLD_STATEID in response to our delegreturn,
we want to sync to the most recent seqid for the delegation stateid. However
if we are already at the most recent, we have two possibilities:

- an OPEN reply is still outstanding and will return a new seqid
- an earlier OPEN reply was dropped on the floor due to a timeout.

In the latter case, we may end up unable to complete the delegreturn,
so we want to bump the seqid to a value greater than the cached value.
While this may cause us to lose the delegation in the former case,
it should now be safe to assume that the client will replay the OPEN
if necessary in order to get a new valid stateid.

Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
fs/nfs/delegation.c
fs/nfs/nfs4proc.c