git: 74cf968007f6 - stable/13 - nfscl: Fix setup of Sequence when all slots marked bad

From: Rick Macklem <>
Date: Fri, 16 Sep 2022 22:22:35 UTC
The branch stable/13 has been updated by rmacklem:


commit 74cf968007f61d74592e08f6f67911eb7a6adf20
Author:     Rick Macklem <>
AuthorDate: 2022-08-28 21:36:45 +0000
Commit:     Rick Macklem <>
CommitDate: 2022-09-16 22:19:33 +0000

    nfscl: Fix setup of Sequence when all slots marked bad
    Commit 40ada74ee1da modified the NFSv4.1/4.2 client so
    that it would issue a DestroySession to the server when
    all session slots are marked bad.  Once this is done,
    the Sequence operation should get a NFSERR_BADSESSION
    reply from the server.
    Without this patch, the code was setting ND_HASSLOTID
    when, in fact, there was no slot marked in use by
    nfsv4_sequencelookup().  This would result in the
    code freeing a slot not in use.  The effect of this
    was minimal, since the session was already destroyed.
    This patch fixes the code so that it does not set
    ND_HASSLOTID for this case.
    (cherry picked from commit 117cea02a4dcd5757d1ed469a14110f4670dedea)
 sys/fs/nfs/nfs_commonsubs.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/sys/fs/nfs/nfs_commonsubs.c b/sys/fs/nfs/nfs_commonsubs.c
index 72482784a0a0..9057689a36e4 100644
--- a/sys/fs/nfs/nfs_commonsubs.c
+++ b/sys/fs/nfs/nfs_commonsubs.c
@@ -4791,7 +4791,6 @@ nfsv4_setsequence(struct nfsmount *nmp, struct nfsrv_descript *nd,
 		if (error == NFSERR_SEQMISORDERED) {
 			/* If all slots are bad, Destroy the session. */
 			nfsrpc_destroysession(nmp, sep, cred, curthread);
-			error = 0;
 	} else
 		error = nfsv4_sequencelookup(nmp, sep, &slotpos, &maxslot,