freebsd-dev/sys/fs/nfsserver
Rick Macklem 8759773148 nfsd: fix the slot sequence# when a callback fails
Commit 4281bfec36 patched the server so that the
callback session slot would be free'd for reuse when
a callback attempt fails.
However, this can often result in the sequence# for
the session slot to be advanced such that the client
end will reply NFSERR_SEQMISORDERED.

To avoid the NFSERR_SEQMISORDERED client reply,
this patch negates the sequence# advance for the
case where the callback has failed.
The common case is a failed back channel, where
the callback cannot be sent to the client, and
not advancing the sequence# is correct for this
case.  For the uncommon case where the client's
reply to the callback is lost, not advancing the
sequence# will indicate to the client that the
next callback is a retry and not a new callback.
But, since the FreeBSD server always sets "csa_cachethis"
false in the callback sequence operation, a retry
and a new callback should be handled the same way
by the client, so this should not matter.

Until you have this patch in your NFSv4.1/4.2 server,
you should consider avoiding the use of delegations.
Even with this patch, interoperation with the
Linux NFSv4.1/4.2 client in kernel versions prior
to 5.3 can result in frequent 15second delays if
delegations are enabled.  This occurs because, for
kernels prior to 5.3, the Linux client does a TCP
reconnect every time it sees multiple concurrent
callbacks and then it takes 15seconds to recover
the back channel after doing so.

MFC after:	2 weeks
2021-04-26 16:24:10 -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 nfsserver: use VOP_VPUT_PAIR(). 2021-02-12 03:02:21 +02:00
nfs_nfsdserv.c fs: clean up empty lines in .c and .h files 2020-09-01 21:18:40 +00:00
nfs_nfsdsocket.c nfs server: improve use of the VFS KPI 2021-01-02 20:17:12 +02:00
nfs_nfsdstate.c nfsd: fix the slot sequence# when a callback fails 2021-04-26 16:24:10 -07:00
nfs_nfsdsubs.c nfsd: fix replies from session cache for retried RPCs 2021-04-08 14:04:22 -07:00