]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
RDS-TCP: only initiate reconnect attempt on outgoing TCP socket.
authorSowmini Varadhan <sowmini.varadhan@oracle.com>
Mon, 11 May 2015 13:39:04 +0000 (09:39 -0400)
committerMukesh Kacker <mukesh.kacker@oracle.com>
Wed, 8 Jul 2015 21:00:19 +0000 (14:00 -0700)
When the peer of an RDS-TCP connection restarts, a reconnect
attempt should only be made from the active side  of the TCP
connection, i.e. the side that has a transient TCP port
number. Do not add the passive side of the TCP connection
to the c_hash_node and thus avoid triggering rds_queue_reconnect()
for passive rds connections.

Orabug: 20930687
Upstream commit-id: c82ac7e69efe6dbe370d6ba84e2666d7692ef1c2

Signed-off-by: Sowmini Varadhan <sowmini.varadhan@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Mukesh Kacker <mukesh.kacker@oracle.com>
net/rds/connection.c

index e0ac13dc9fdf2abf1eee3b784071a5f66e8c3930..1d118e053725a1d36d2e70e1634ab997f311341c 100644 (file)
@@ -253,13 +253,22 @@ new_conn:
                /* Creating normal conn */
                struct rds_connection *found;
 
-               found = rds_conn_lookup(head, laddr, faddr, trans, tos);
+               if (!is_outgoing && otrans->t_type == RDS_TRANS_TCP)
+                       found = NULL;
+               else
+                       found = rds_conn_lookup(head, laddr, faddr, trans, tos);
                if (found) {
                        trans->conn_free(conn->c_transport_data);
                        kmem_cache_free(rds_conn_slab, conn);
                        conn = found;
                } else {
-                       hlist_add_head_rcu(&conn->c_hash_node, head);
+                       if ((is_outgoing && otrans->t_type == RDS_TRANS_TCP) ||
+                           (otrans->t_type != RDS_TRANS_TCP)) {
+                               /* Only the active side should be added to
+                                * reconnect list for RDS-TCP.
+                                */
+                               hlist_add_head_rcu(&conn->c_hash_node, head);
+                       }
                        rds_cong_add_conn(conn);
                        rds_conn_count++;
                }