git: 117cea02a4dc - main - nfscl: Fix setup of Sequence when all slots marked bad

From: Rick Macklem <rmacklem_at_FreeBSD.org>
Date: Sun, 28 Aug 2022 21:37:32 UTC
The branch main has been updated by rmacklem:

URL: https://cgit.FreeBSD.org/src/commit/?id=117cea02a4dcd5757d1ed469a14110f4670dedea

commit 117cea02a4dcd5757d1ed469a14110f4670dedea
Author:     Rick Macklem <rmacklem@FreeBSD.org>
AuthorDate: 2022-08-28 21:36:45 +0000
Commit:     Rick Macklem <rmacklem@FreeBSD.org>
CommitDate: 2022-08-28 21:36:45 +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.
    
    MFC after:      2 weeks
---
 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 6dd1a3e4c579..06b0354e06a7 100644
--- a/sys/fs/nfs/nfs_commonsubs.c
+++ b/sys/fs/nfs/nfs_commonsubs.c
@@ -4787,7 +4787,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,