• Trond Myklebust's avatar
    SUNRPC/xprtrdma: Fix reconnection locking · f99fa508
    Trond Myklebust authored
    The xprtrdma client code currently relies on the task that initiated the
    connect to hold the XPRT_LOCK for the duration of the connection
    attempt. If the task is woken early, due to some other event, then that
    lock could get released early.
    Avoid races by using the same mechanism that the socket code uses of
    transferring lock ownership to the RDMA connect worker itself. That
    frees us to call rpcrdma_xprt_disconnect() directly since we're now
    guaranteed exclusion w.r.t. other callers.
    
    Fixes: 4cf44be6 ("xprtrdma: Fix recursion into rpcrdma_xprt_disconnect()")
    Signed-off-by: default avatarTrond Myklebust <trond.myklebust@hammerspace.com>
    Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
    f99fa508
transport.c 21.8 KB