]> www.infradead.org Git - users/jedix/linux-maple.git/commit
RDS-TCP: Always create a new rds_sock for an incoming connection.
authorSowmini Varadhan <sowmini.varadhan@oracle.com>
Mon, 11 May 2015 13:32:51 +0000 (09:32 -0400)
committerMukesh Kacker <mukesh.kacker@oracle.com>
Wed, 8 Jul 2015 21:00:18 +0000 (14:00 -0700)
commit945da834f3bc465cea01c85f26c4e75571270189
treea03dae84b57d3ef0b7444c94bd754c092199cae2
parent57f2563085e1ad3fc114856254f87f1bdd4e24b5
RDS-TCP: Always create a new rds_sock for an incoming connection.

When running RDS over TCP, the active (client) side connects to the
listening ("passive") side at the RDS_TCP_PORT.  After the connection
is established, if the client side reboots (potentially without even
sending a FIN) the server still has a TCP socket in the esablished
state.  If the server-side now gets a new SYN comes from the client
with a different client port, TCP will create a new socket-pair, but
the RDS layer will incorrectly pull up the old rds_connection (which
is still associated with the stale t_sock and RDS socket state).

This patch corrects this behavior by having rds_tcp_accept_one()
always create a new connection for an incoming TCP SYN.
The rds and tcp state associated with the old socket-pair is cleaned
up via the rds_tcp_state_change() callback which would typically be
invoked in most cases when the client-TCP sends a FIN on TCP restart,
triggering a transition to CLOSE_WAIT state. In the rarer event of client
death without a FIN, TCP_KEEPALIVE probes on the socket will detect
the stale socket, and the TCP transition to CLOSE state will trigger
the RDS state cleanup.

Orabug: 20930687
Upstream commit-id: f711a6ae062caeee46067b2f2f12ffda319ae73c

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
net/rds/tcp_connect.c
net/rds/tcp_listen.c