[DR_CONN_CONNECT_FAIL] = "conn_connect failure",
[DR_HB_TIMEOUT] = "hb timeout",
[DR_RECONNECT_TIMEOUT] = "reconnect timeout",
+ [DR_SOCK_CANCEL] = "cancel operation on socket",
[DR_IB_CONN_DROP_RACE] = "race between ESTABLISHED event and drop",
[DR_IB_NOT_CONNECTING_STATE] = "conn is not in CONNECTING state",
[DR_IB_QP_EVENT] = "qp event",
struct rds_connection *conn;
unsigned long flags;
LIST_HEAD(list);
+ int conn_dropped = 0;
/* get all the messages we're dropping under the rs lock */
spin_lock_irqsave(&rs->rs_lock, flags);
while (!list_empty(&list)) {
rm = list_entry(list.next, struct rds_message, m_sock_item);
list_del_init(&rm->m_sock_item);
+
+ /* Drop the connection only if this is part of cancel.
+ * For a paticular dest and for a sock, all the rms cancelled
+ * belong to the same connection.
+ */
+ if (!conn_dropped && dest &&
+ test_bit(RDS_MSG_MAPPED, &rm->m_flags)) {
+ conn->c_drop_source = DR_SOCK_CANCEL;
+ rds_conn_drop(conn);
+ conn_dropped = 1;
+ }
rds_message_wait(rm);
/*