diff options
author | Rick Macklem <rmacklem@FreeBSD.org> | 2022-08-26 03:33:31 +0000 |
---|---|---|
committer | Rick Macklem <rmacklem@FreeBSD.org> | 2022-09-02 02:12:21 +0000 |
commit | e1dd3e56878907f4321fa5456eb23914673dc930 (patch) | |
tree | 71e286cb0b3c10082fbbf64f575c1f1dc54437df | |
parent | f4036d3241cf4e1f78cff77aaaf05e962ebaf46e (diff) | |
download | src-e1dd3e56878907f4321fa5456eb23914673dc930.tar.gz src-e1dd3e56878907f4321fa5456eb23914673dc930.zip |
nfscl: Fix handling of a bad session slot (NFSv4.1/4.2)
When a session has been marked defunct by the server
sending a NFSERR_BADSESSION reply to the NFSv4.1/4.2
client, nfsv4_sequencelookup() returns NFSERR_BADSESSION
without actually assigning a session slot.
Without this patch, newnfs_request() would erroneously
free slot 0.
This could result in the slot being reused prematurely,
but most likely just generated a "freeing free slot!!"
console message.
This patch fixes the code to not do the erroneous
freeing of the slot for this case.
PR: 260011
(cherry picked from commit 2b612c9d3bb528551de9eaabbdbadae89a36ba8b)
-rw-r--r-- | sys/fs/nfs/nfs_commonkrpc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/fs/nfs/nfs_commonkrpc.c b/sys/fs/nfs/nfs_commonkrpc.c index 93d305f0547b..934e964b35d6 100644 --- a/sys/fs/nfs/nfs_commonkrpc.c +++ b/sys/fs/nfs/nfs_commonkrpc.c @@ -966,12 +966,12 @@ tryagain: "slot=%d\n", slot); slot = nd->nd_slotid; } + freeslot = slot; } else if (slot != 0) { printf("newnfs_request: Bad " "session slot=%d\n", slot); slot = 0; } - freeslot = slot; if (retseq != sep->nfsess_slotseq[slot]) printf("retseq diff 0x%x\n", retseq); |