diff options
author | Rick Macklem <rmacklem@FreeBSD.org> | 2022-08-26 03:48:04 +0000 |
---|---|---|
committer | Rick Macklem <rmacklem@FreeBSD.org> | 2022-08-26 03:48:04 +0000 |
commit | 8e59ec29e47f6ec64f54ddd88cab388ae536f0ff (patch) | |
tree | 868d414a5f5f0d39a267d139d40ff492c86c5c13 | |
parent | 2b612c9d3bb528551de9eaabbdbadae89a36ba8b (diff) | |
download | src-8e59ec29e47f6ec64f54ddd88cab388ae536f0ff.tar.gz src-8e59ec29e47f6ec64f54ddd88cab388ae536f0ff.zip |
nfscl: Fix handling of nd_slotid while handling NFSERR_BADSESSION
When the NFSv4.1/4.2 client is handling a server error
of NFSERR_BADSESSION, it retries RPCs with a new session.
Without this patch, the nd_slotid was not being updated
for the new session.
This would result in a bogus console message like
"Wrong session srvslot=X slot=Y" and then it would
free the incorrect slot, often generating a
"freeing free slot!!" console message as well.
This patch fixes the problem.
Note that FreeBSD NFSv4.1/4.2 servers only
generate a NFSERR_BADSESSION error after a reboot
or after a client does a DestroySession operation.
PR: 260011
MFC after: 1 week
-rw-r--r-- | sys/fs/nfs/nfs_commonkrpc.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/fs/nfs/nfs_commonkrpc.c b/sys/fs/nfs/nfs_commonkrpc.c index 916d0182d3ee..d630c6c69ede 100644 --- a/sys/fs/nfs/nfs_commonkrpc.c +++ b/sys/fs/nfs/nfs_commonkrpc.c @@ -1169,6 +1169,9 @@ tryagain: *tl++ = txdr_unsigned(slotseq); *tl++ = txdr_unsigned(slotpos); *tl = txdr_unsigned(maxslot); + if ((nd->nd_flag & + ND_HASSLOTID) != 0) + nd->nd_slotid = slotpos; } if (reterr == NFSERR_BADSESSION || reterr == 0) { |