HomeFreeBSD

nfscl: Fix setting of nfsess_defunct for nfscl_hasexpired()

Description

nfscl: Fix setting of nfsess_defunct for nfscl_hasexpired()

Commit a7bb120f8b87 added a printf for the case where recovery
has not marked the session defunct by setting nfsess_defunct
to 1. It turns out that nfscl_hasexpired() calls
nfsrpc_setclient() directly, without setting nfsess_defunct.
This patch replaces the printf with code that sets
nfsess_defunct to 1 to handle this case.

If SIGTERM is issued to a process when it is doing I/O on
an "intr" mount, the NFSv4 server may reply NFSERR_BADSTATEID,
due to the Open being prematurely closed.
This can result in a call to nfscl_hasexpired() to do a
recovery.

This would explain at least one hang described in the PR.

PR: 260011
MFC after: 2 weeks

(cherry picked from commit be7b87de16ffbabb81989e13a4b19a178e3ab8ee)

Details

Provenance
rmacklemAuthored on Jul 8 2022, 2:37 PM
Parents
rG3a5a2ecda091: Suppress unused variable warning in if_mwl.c
Branches
Unknown
Tags
Unknown