From: Bang Nguyen Date: Thu, 15 Aug 2013 03:03:17 +0000 (-0700) Subject: RDS: Reconnect causes panic at completion phase X-Git-Tag: v4.1.12-92~293^2^2~49 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=ea5eabfe6c17a4699dddfd0dbfea60f947b0d030;p=users%2Fjedix%2Flinux-maple.git RDS: Reconnect causes panic at completion phase The connection can be shutdown while it is processing the RDMA_CM_EVENT_ESTABLISHED event, and this can lead to panic if the cm_id has been destroyed. The fix was to drop the connection if the cm_id has been destroyed. Orabug: 17213597 Signed-off-by: Richard Frank (cherry picked from commit 000fdbea7eab93fc55c45de7302b6560fd41b7f1) --- diff --git a/net/rds/ib_cm.c b/net/rds/ib_cm.c index 2982161177f4..11e2a5f831fa 100644 --- a/net/rds/ib_cm.c +++ b/net/rds/ib_cm.c @@ -170,6 +170,12 @@ void rds_ib_cm_connect_complete(struct rds_connection *conn, struct rdma_cm_even RDS_PROTOCOL_MINOR(conn->c_version), ic->i_flowctl ? ", flow control" : ""); + /* The connection might have been dropped under us*/ + if (!ic->i_cm_id) { + rds_conn_drop(conn); + return; + } + ic->i_sl = ic->i_cm_id->route.path_rec->sl; /* diff --git a/net/rds/rdma_transport.c b/net/rds/rdma_transport.c index 407e13166deb..812d1da86d7d 100644 --- a/net/rds/rdma_transport.c +++ b/net/rds/rdma_transport.c @@ -113,9 +113,9 @@ int rds_rdma_cm_event_handler(struct rdma_cm_id *cm_id, if (ibic && ibic->i_cm_id == cm_id) ibic->i_cm_id = NULL; rds_conn_drop(conn); - } else if (conn->c_to_index < (RDS_RDMA_RESOLVE_TO_MAX_INDEX-1)) + } + } else if (conn->c_to_index < (RDS_RDMA_RESOLVE_TO_MAX_INDEX-1)) conn->c_to_index++; - } break; case RDMA_CM_EVENT_ROUTE_RESOLVED: