• Rick Macklem's avatar
    nfsv4 client: do the BindConnectionToSession as required · 7763814f
    Rick Macklem authored
    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
    Comments by:	asomers
    MFC after:	2 weeks
    Differential Revision:	https://reviews.freebsd.org/D29475