Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 26 Aug 2022 03:35:37 GMT
From:      Rick Macklem <rmacklem@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 2b612c9d3bb5 - main - nfscl: Fix handling of a bad session slot (NFSv4.1/4.2)
Message-ID:  <202208260335.27Q3ZblC092356@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by rmacklem:

URL: https://cgit.FreeBSD.org/src/commit/?id=2b612c9d3bb528551de9eaabbdbadae89a36ba8b

commit 2b612c9d3bb528551de9eaabbdbadae89a36ba8b
Author:     Rick Macklem <rmacklem@FreeBSD.org>
AuthorDate: 2022-08-26 03:33:31 +0000
Commit:     Rick Macklem <rmacklem@FreeBSD.org>
CommitDate: 2022-08-26 03:33:31 +0000

    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
    MFC after:      1 week
---
 sys/fs/nfs/nfs_commonkrpc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/fs/nfs/nfs_commonkrpc.c b/sys/fs/nfs/nfs_commonkrpc.c
index 150d92414e7a..916d0182d3ee 100644
--- a/sys/fs/nfs/nfs_commonkrpc.c
+++ b/sys/fs/nfs/nfs_commonkrpc.c
@@ -1080,12 +1080,12 @@ tryagain:
 						    }
 						    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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202208260335.27Q3ZblC092356>