Created attachment 223883 [details]
fix NFSv4.1/4.2 client to do a BindConnectionToSession to maintain the backchannel
When the FreeBSD NFS client does a 4.1/4.2 mount
and the nfscbd(8) daemon is running, it binds the
TCP connection to both the fore (client->server RPCs)
and back (server->client callback RPCs) via CreateSession.
When the client finds the NFS server unresponsive,
it creates a new TCP connection. It then does an RPC
with a Sequence operation in it, binding the new
connection to the fore channel, but not the back
--> callback RPCs can no longer work.
The attachment patch modifies the client so that
the krpc does a BindConnectionToSession RPC as the
first RPC on the new connection, so that both the
fore and back channels are bound, as the were for
the original connection.
Loss of a back channel/ability to do callback RPCs
only affects delegations and pNFS.
--> Until patched the workaround is to not run
the nfscbd(8) daemon on the client so that
callbacks are never enabled and the NFSv4.n
server should never issue delegations to the
Created attachment 224005 [details]
same as fix NFSv4.1/4.2 ... but for FreeBSD12
Same as attachment 223883 [details], but for FreeBSD12 instead
A commit in branch main references this bug:
Author: Rick Macklem <rmacklem@FreeBSD.org>
AuthorDate: 2021-04-11 21:34:57 +0000
Commit: Rick Macklem <rmacklem@FreeBSD.org>
CommitDate: 2021-04-11 21:34:57 +0000
nfsv4 client: do the BindConnectionToSession as required
During a recent testing event, it was reported that the NFSv4.1/4.2
server erroneously bound the back channel to a new TCP connection.
RFC5661 specifies that the fore channel is implicitly bound to a
new TCP connection when an RPC with Sequence (almost any of them)
is done on it. For the back channel to be bound to the new TCP
connection, an explicit BindConnectionToSession must be done as
the first RPC on the new connection.
Since new TCP connections are created by the "reconnect" layer
(sys/rpc/clnt_rc.c) of the krpc, this patch adds an optional
upcall done by the krpc whenever a new connection is created.
The patch also adds the specific upcall function that does a
BindConnectionToSession and configures the krpc to call it
This is necessary for correct interoperability with NFSv4.1/NFSv4.2
servers when the nfscbd daemon is running.
If doing NFSv4.1/NFSv4.2 mounts without this patch, it is
recommended that the nfscbd daemon not be running and that
the "pnfs" mount option not be specified.
Comments by: asomers
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D29475
sys/fs/nfs/nfs_commonsubs.c | 5 ++-
sys/fs/nfs/nfs_var.h | 1 +
sys/fs/nfs/nfscl.h | 5 +++
sys/fs/nfs/nfsport.h | 9 +++--
sys/fs/nfs/nfsproto.h | 5 ++-
sys/fs/nfsclient/nfs_clrpcops.c | 90 +++++++++++++++++++++++++++++++++++++++++
sys/rpc/clnt.h | 6 +++
sys/rpc/clnt_rc.c | 15 +++++++
sys/rpc/krpc.h | 3 ++
9 files changed, 133 insertions(+), 6 deletions(-)