nfscl: Do not delay recovery for a stale ClientID

When a CREATE_SESSION with the extant ClientID failed with
NFS4ERR_STALE_CLIENTID within nfsc_renew of the previous full recovery,
nfsrpc_setclient() returned EIO and the mount did no I/O until that window
expired (about 45s).
The server has discarded the ClientID, so waiting cannot help; RFC 8881
Section 8.4.2 requires a new ClientID (EXCHANGE_ID) and a state reclaim.

AWS EFS discards both the session and the ClientID of clients whose lease is
current whenever it resets a connection, which makes this path common there.

PR:		299221
Approved by:	rmacklem@
Sponsored by:	Netflix
This commit is contained in:
Olivier Cochard committed 2026-11-02 00:29:58 +01:00
1 parent 64857418bb
commit 7a0021a098
1 file changed
+6 -3
+6 -3
View File
@@ -1069,12 +1069,15 @@ nfsrpc_setclient(struct nfsmount *nmp, struct nfsclclient *clp, int reclaim,
nfscl_freenfsclds(dsp);
dsp = NULL;
/*
* If *retokp is true, return any error other
* than NFSERR_STALECLIENTID,
* A stale ClientID needs a full recovery.
* Otherwise, if *retokp is true, return any
* error other than NFSERR_STALECLIENTID,
* NFSERR_BADSESSION or NFSERR_STALEDONTRECOVER
* so that nfscl_recover() will not loop.
*/
if (*retokp)
if (error == NFSERR_STALECLIENTID)
*retokp = false;
else if (*retokp)
return (NFSERR_IO);
} else
*retokp = true;