[rds-devel] [PATCH net-next] rds: Cancel pending connections on connection request

Dag Moxnes dag.moxnes at oracle.com
Thu Oct 31 06:35:56 PDT 2019


RDS connections can enter the RDS_CONN_CONNECTING state in two ways:
1. It can be started using the connection workqueue (this can happen
both on queue_reconnect and upon send if the workqueue is not up)
2. It can enter the RDS_CONN_CONNECTING state due to an incoming
connection request

In case RDS connections enter RDS_CONN_CONNECTION state due to an incoming
connection request, the connection workqueue might already be scheduled. In
this case the connection workqueue needs to be cancelled.

Signed-off-by: Dag Moxnes <dag.moxnes at oracle.com>
---
 net/rds/ib_cm.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/net/rds/ib_cm.c b/net/rds/ib_cm.c
index 6b345c858d..1fdd76f70d 100644
--- a/net/rds/ib_cm.c
+++ b/net/rds/ib_cm.c
@@ -880,6 +880,12 @@ int rds_ib_cm_handle_connect(struct rdma_cm_id *cm_id,
 			rds_ib_stats_inc(s_ib_connect_raced);
 		}
 		goto out;
+	} else {
+		/* Cancel any pending reconnect */
+		struct rds_conn_path *cp = &conn->c_path[0];
+
+		cancel_delayed_work_sync(&cp->cp_conn_w);
+		rds_clear_reconnect_pending_work_bit(cp);
 	}
 
 	ic = conn->c_transport_data;
-- 
2.20.1




More information about the rds-devel mailing list