]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
nfscl: Fix NFSv4.1/4.2 mount recovery from an expired lease
authorRick Macklem <rmacklem@FreeBSD.org>
Wed, 19 May 2021 21:52:56 +0000 (14:52 -0700)
committerRick Macklem <rmacklem@FreeBSD.org>
Wed, 19 May 2021 21:52:56 +0000 (14:52 -0700)
commitc28cb257ddfe3339756f6fd659fa4a2efa4de2cb
tree386cefade041aecd4064dc30452f9c0a938a0934
parentfe815b88b553667c40353c46b58f9779efa3570e
nfscl: Fix NFSv4.1/4.2 mount recovery from an expired lease

The most difficult NFSv4 client recovery case happens when the
lease has expired on the server.  For NFSv4.0, the client will
receive a NFSERR_EXPIRED reply from the server to indicate this
has happened.
For NFSv4.1/4.2, most RPCs have a Sequence operation and, as such,
the client will receive a NFSERR_BADSESSION reply when the lease
has expired for these RPCs.  The client will then call nfscl_recover()
to handle the NFSERR_BADSESSION reply.  However, for the expired lease
case, the first reclaim Open will fail with NFSERR_NOGRACE.

This patch recognizes this case and calls nfscl_expireclient()
to handle the recovery from an expired lease.

This patch only affects NFSv4.1/4.2 mounts when the lease
expires on the server, due to a network partitioning that
exceeds the lease duration or similar.

MFC after: 2 weeks
sys/fs/nfsclient/nfs_clstate.c