diff options
-rw-r--r-- | net/rds/connection.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/net/rds/connection.c b/net/rds/connection.c index 60f0cd6ed15f..da6da57e5f36 100644 --- a/net/rds/connection.c +++ b/net/rds/connection.c | |||
@@ -234,13 +234,22 @@ new_conn: | |||
234 | /* Creating normal conn */ | 234 | /* Creating normal conn */ |
235 | struct rds_connection *found; | 235 | struct rds_connection *found; |
236 | 236 | ||
237 | found = rds_conn_lookup(head, laddr, faddr, trans); | 237 | if (!is_outgoing && otrans->t_type == RDS_TRANS_TCP) |
238 | found = NULL; | ||
239 | else | ||
240 | found = rds_conn_lookup(head, laddr, faddr, trans); | ||
238 | if (found) { | 241 | if (found) { |
239 | trans->conn_free(conn->c_transport_data); | 242 | trans->conn_free(conn->c_transport_data); |
240 | kmem_cache_free(rds_conn_slab, conn); | 243 | kmem_cache_free(rds_conn_slab, conn); |
241 | conn = found; | 244 | conn = found; |
242 | } else { | 245 | } else { |
243 | hlist_add_head_rcu(&conn->c_hash_node, head); | 246 | if ((is_outgoing && otrans->t_type == RDS_TRANS_TCP) || |
247 | (otrans->t_type != RDS_TRANS_TCP)) { | ||
248 | /* Only the active side should be added to | ||
249 | * reconnect list for TCP. | ||
250 | */ | ||
251 | hlist_add_head_rcu(&conn->c_hash_node, head); | ||
252 | } | ||
244 | rds_cong_add_conn(conn); | 253 | rds_cong_add_conn(conn); |
245 | rds_conn_count++; | 254 | rds_conn_count++; |
246 | } | 255 | } |