From: Serguei Smirnov Date: Thu, 8 Sep 2022 22:27:12 +0000 (-0700) Subject: LU-15885 o2iblnd: fix handling of RDMA_CM_EVENT_UNREACHABLE X-Git-Tag: 2.15.53~171 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=3925b1669d519e6c038ecce1287c1ced3de623d3;p=fs%2Flustre-release.git LU-15885 o2iblnd: fix handling of RDMA_CM_EVENT_UNREACHABLE RDMA_CM_EVENT_UNREACHABLE may be received not only when connection is being connected, but also when it is being closed. Fix handing of this event accordingly. Test-Parameters: trivial Signed-off-by: Serguei Smirnov Change-Id: I79428188c159b2d80d36326589b2977db065d4a7 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/48492 Reviewed-by: Frank Sehr Reviewed-by: Chris Horn Reviewed-by: Oleg Drokin Tested-by: jenkins Tested-by: Maloo --- diff --git a/lnet/klnds/o2iblnd/o2iblnd_cb.c b/lnet/klnds/o2iblnd/o2iblnd_cb.c index 1030bba..9c2b574 100644 --- a/lnet/klnds/o2iblnd/o2iblnd_cb.c +++ b/lnet/klnds/o2iblnd/o2iblnd_cb.c @@ -3265,12 +3265,17 @@ kiblnd_cm_callback(struct rdma_cm_id *cmid, struct rdma_cm_event *event) case RDMA_CM_EVENT_UNREACHABLE: conn = cmid->context; - LASSERT(conn->ibc_state == IBLND_CONN_ACTIVE_CONNECT || - conn->ibc_state == IBLND_CONN_PASSIVE_WAIT); - CNETERR("%s: UNREACHABLE %d\n", - libcfs_nid2str(conn->ibc_peer->ibp_nid), event->status); - kiblnd_connreq_done(conn, -ENETDOWN); - kiblnd_conn_decref(conn); + CNETERR("%s: UNREACHABLE %d, ibc_state: %d\n", + libcfs_nid2str(conn->ibc_peer->ibp_nid), + event->status, + conn->ibc_state); + LASSERT(conn->ibc_state != IBLND_CONN_ESTABLISHED && + conn->ibc_state != IBLND_CONN_INIT); + if (conn->ibc_state == IBLND_CONN_ACTIVE_CONNECT || + conn->ibc_state == IBLND_CONN_PASSIVE_WAIT) { + kiblnd_connreq_done(conn, -ENETDOWN); + kiblnd_conn_decref(conn); + } return 0; case RDMA_CM_EVENT_CONNECT_ERROR: