rpcrdma: fix handling for RDMA_CM_EVENT_DEVICE_REMOVAL
authorDan Aloni <dan.aloni@vastdata.com>
Mon, 6 May 2024 09:37:59 +0000 (12:37 +0300)
committerTrond Myklebust <trond.myklebust@hammerspace.com>
Mon, 20 May 2024 15:37:15 +0000 (11:37 -0400)
commit4836da219781ec510c4c0303df901aa643507a7a
tree3a9fefd07838db64b2fc47c42b2c5447e93b8a95
parentd1404e46ae4688c74e7504195f4fe253bcce1522
rpcrdma: fix handling for RDMA_CM_EVENT_DEVICE_REMOVAL

Under the scenario of IB device bonding, when bringing down one of the
ports, or all ports, we saw xprtrdma entering a non-recoverable state
where it is not even possible to complete the disconnect and shut it
down the mount, requiring a reboot. Following debug, we saw that
transport connect never ended after receiving the
RDMA_CM_EVENT_DEVICE_REMOVAL callback.

The DEVICE_REMOVAL callback is irrespective of whether the CM_ID is
connected, and ESTABLISHED may not have happened. So need to work with
each of these states accordingly.

Fixes: 2acc5cae2923 ('xprtrdma: Prevent dereferencing r_xprt->rx_ep after it is freed')
Cc: Sagi Grimberg <sagi.grimberg@vastdata.com>
Signed-off-by: Dan Aloni <dan.aloni@vastdata.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
net/sunrpc/xprtrdma/verbs.c