aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRick Macklem <rmacklem@FreeBSD.org>2022-08-27 23:03:18 +0000
committerRick Macklem <rmacklem@FreeBSD.org>2022-08-27 23:03:18 +0000
commitfb29f817586972444d65b1548287a51f27891639 (patch)
treead73f50c10cffd4fced6a170928b0a3acf3393ec
parentf2dfe607761c9b9dd78a336da20ce8d54c1e3cb6 (diff)
downloadsrc-fb29f817586972444d65b1548287a51f27891639.tar.gz
src-fb29f817586972444d65b1548287a51f27891639.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.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/fs/nfs/nfs_commonkrpc.c b/sys/fs/nfs/nfs_commonkrpc.c
index 916d0182d3ee..91ebd84fabd0 100644
--- a/sys/fs/nfs/nfs_commonkrpc.c
+++ b/sys/fs/nfs/nfs_commonkrpc.c
@@ -1169,6 +1169,8 @@ tryagain:
*tl++ = txdr_unsigned(slotseq);
*tl++ = txdr_unsigned(slotpos);
*tl = txdr_unsigned(maxslot);
+ nd->nd_slotid = slotpos;
+ nd->nd_flag |= ND_HASSLOTID;
}
if (reterr == NFSERR_BADSESSION ||
reterr == 0) {