]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
nfsv4 client: do the BindConnectionToSession as required
authorRick Macklem <rmacklem@FreeBSD.org>
Sun, 11 Apr 2021 21:34:57 +0000 (14:34 -0700)
committerRick Macklem <rmacklem@FreeBSD.org>
Fri, 30 Apr 2021 00:43:50 +0000 (17:43 -0700)
commit5a45802b3c8c3962649f47b01453c819dd137da1
tree96135353911aec346ae92126bf50161e144b24ec
parentaa4eb2089751cd0039d114a0fd016d2d7fddc5e9
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
when required.

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.

PR: 254840

(cherry picked from commit 7763814fc9c27a98fefcbf582d7a936ea43af23a)
sys/fs/nfs/nfs_commonsubs.c
sys/fs/nfs/nfs_var.h
sys/fs/nfs/nfscl.h
sys/fs/nfs/nfsport.h
sys/fs/nfs/nfsproto.h
sys/fs/nfsclient/nfs_clrpcops.c
sys/rpc/clnt.h
sys/rpc/clnt_rc.c
sys/rpc/krpc.h