mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 10:40:15 +02:00 
			
		
		
		
	net/rds: RDS-TCP: only initiate reconnect attempt on outgoing TCP socket.
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. Signed-off-by: Sowmini Varadhan <sowmini.varadhan@oracle.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
		
							parent
							
								
									f711a6ae06
								
							
						
					
					
						commit
						c82ac7e69e
					
				
					 1 changed files with 11 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -234,13 +234,22 @@ static struct rds_connection *__rds_conn_create(__be32 laddr, __be32 faddr,
 | 
			
		|||
		/* Creating normal conn */
 | 
			
		||||
		struct rds_connection *found;
 | 
			
		||||
 | 
			
		||||
		if (!is_outgoing && otrans->t_type == RDS_TRANS_TCP)
 | 
			
		||||
			found = NULL;
 | 
			
		||||
		else
 | 
			
		||||
			found = rds_conn_lookup(head, laddr, faddr, trans);
 | 
			
		||||
		if (found) {
 | 
			
		||||
			trans->conn_free(conn->c_transport_data);
 | 
			
		||||
			kmem_cache_free(rds_conn_slab, conn);
 | 
			
		||||
			conn = found;
 | 
			
		||||
		} else {
 | 
			
		||||
			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 TCP.
 | 
			
		||||
				 */
 | 
			
		||||
				hlist_add_head_rcu(&conn->c_hash_node, head);
 | 
			
		||||
			}
 | 
			
		||||
			rds_cong_add_conn(conn);
 | 
			
		||||
			rds_conn_count++;
 | 
			
		||||
		}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue