aboutsummaryrefslogtreecommitdiff
path: root/sys/fs/nfs/nfsrvstate.h
diff options
context:
space:
mode:
authorRick Macklem <rmacklem@FreeBSD.org>2022-07-13 23:28:56 +0000
committerRick Macklem <rmacklem@FreeBSD.org>2022-07-13 23:28:56 +0000
commit088ba4356a114416b1d68bf5ae3b3e0accf6d0df (patch)
tree22765c3c7e3d4ea730801dc40f7f8232a19826bd /sys/fs/nfs/nfsrvstate.h
parentb18071361209a05f488ada6e4312bd4294f26424 (diff)
downloadsrc-088ba4356a114416b1d68bf5ae3b3e0accf6d0df.tar.gz
src-088ba4356a114416b1d68bf5ae3b3e0accf6d0df.zip
nfsd: Fix CreateSession for an established ClientID
I mis-read the RFC w.r.t. handling of the sequenceid when a CreateSession is done after the initial one that confirms the ClientID. Fortunately this does not affect most extant NFSv4.1/4.2 clients, since they only acquire a single session for TCP for a ClientID (Solaris might be an exception?). This patch fixes the server to handle this case, where the RFC requires the sequenceid be incremented for each CreateSession and is required to reply to a retried CreateSession with a cached reply. It adds a field to nfsclient called lc_prevsess, which caches the sessionid, which is the only field in a CreateSession reply that will change for a retry, to implement this reply cache. The recent commits up to d4a11b3e3bdd that mark session slots bad when "intr" and/or "soft" mounts are used by the client needs this server patch. Without this patch, the client will do a full recovery, including a new ClientID, losing all byte range locks. However, prior to the recent client commits, the client would hang when all session slots were bad, so even without this patch it is not a regression. PR: 260011 MFC after: 2 weeks
Diffstat (limited to 'sys/fs/nfs/nfsrvstate.h')
-rw-r--r--sys/fs/nfs/nfsrvstate.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/fs/nfs/nfsrvstate.h b/sys/fs/nfs/nfsrvstate.h
index 9eebeece9727..4c171e8b3f50 100644
--- a/sys/fs/nfs/nfsrvstate.h
+++ b/sys/fs/nfs/nfsrvstate.h
@@ -99,6 +99,7 @@ struct nfsclient {
struct nfsstatehead lc_deleg; /* Delegations */
struct nfsstatehead lc_olddeleg; /* and old delegations */
struct nfssessionhead lc_session; /* List of NFSv4.1 sessions */
+ uint64_t lc_prevsess; /* CreateSession cache */
time_t lc_expiry; /* Expiry time (sec) */
time_t lc_delegtime; /* Old deleg expiry (sec) */
nfsquad_t lc_clientid; /* 64 bit clientid */