freebsd-dev/sys/fs/nfsserver
Rick Macklem 088ba4356a 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 d4a11b3e3b 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
2022-07-13 16:28:56 -07:00
..
nfs_fha_new.c fs: clean up empty lines in .c and .h files 2020-09-01 21:18:40 +00:00
nfs_fha_new.h Re-organize the NFS file handle affinity code for the NFS server. 2020-04-14 00:01:26 +00:00
nfs_nfsdcache.c fs: clean up empty lines in .c and .h files 2020-09-01 21:18:40 +00:00
nfs_nfsdkrpc.c nfsd: fix replies from session cache for retried RPCs 2021-04-08 14:04:22 -07:00
nfs_nfsdport.c nfscl: Change the cred argument to non-NULL for pNFS proxies 2022-07-08 17:27:23 -07:00
nfs_nfsdserv.c nfsd: Clean up the code by not using the vnode_vtype() macro 2022-06-22 13:20:32 -07:00
nfs_nfsdsocket.c nfsd: Fix the NFSv4.2 pNFS MDS server for NFSERR_NOSPC via LayoutError 2021-11-08 15:58:00 -08:00
nfs_nfsdstate.c nfsd: Fix CreateSession for an established ClientID 2022-07-13 16:28:56 -07:00
nfs_nfsdsubs.c rpc: Delete AUTH_NEEDS_TLS(_MUTUAL_HOST) auth_stat values 2021-12-23 14:31:53 -08:00