HomeFreeBSD

nfscl: Fix NFSv4.1/4.2 mount recovery from an expired lease

Description

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.

(cherry picked from commit c28cb257ddfe3339756f6fd659fa4a2efa4de2cb)

Details

Provenance
rmacklemAuthored on May 19 2021, 9:52 PM
Parents
rG02966cbdf03a: Fix fsck_ufs segfault when it needs to rerun.
Branches
Unknown
Tags
Unknown