diff options
author | Sowmini Varadhan <sowmini.varadhan@oracle.com> | 2016-06-04 13:59:58 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-06-07 15:10:15 -0700 |
commit | 335b48d980f631fbc5b233cbb3625ac0c86d67cb (patch) | |
tree | c09223b2cdbe5b6a9d876ad07a9ee29cebcb8588 /net/rds/tcp.h | |
parent | 80e509db54c81247b32fcb75bb1730fc789b893d (diff) | |
download | linux-335b48d980f631fbc5b233cbb3625ac0c86d67cb.tar.bz2 |
RDS: TCP: Add/use rds_tcp_reset_callbacks to reset tcp socket safely
When rds_tcp_accept_one() has to replace the existing tcp socket
with a newer tcp socket (duelling-syn resolution), it must lock_sock()
to suppress the rds_tcp_data_recv() path while callbacks are being
changed. Also, existing RDS datagram reassembly state must be reset,
so that the next datagram on the new socket does not have corrupted
state. Similarly when resetting the newly accepted socket, appropriate
locks and synchronization is needed.
This commit ensures correct synchronization by invoking
kernel_sock_shutdown to reset a newly accepted sock, and by taking
appropriate lock_sock()s (for old and new sockets) when resetting
existing callbacks.
Signed-off-by: Sowmini Varadhan <sowmini.varadhan@oracle.com>
Acked-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/rds/tcp.h')
-rw-r--r-- | net/rds/tcp.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/net/rds/tcp.h b/net/rds/tcp.h index 41c228300525..ec0602b0dc24 100644 --- a/net/rds/tcp.h +++ b/net/rds/tcp.h @@ -50,6 +50,7 @@ struct rds_tcp_statistics { void rds_tcp_tune(struct socket *sock); void rds_tcp_nonagle(struct socket *sock); void rds_tcp_set_callbacks(struct socket *sock, struct rds_connection *conn); +void rds_tcp_reset_callbacks(struct socket *sock, struct rds_connection *conn); void rds_tcp_restore_callbacks(struct socket *sock, struct rds_tcp_connection *tc); u32 rds_tcp_snd_nxt(struct rds_tcp_connection *tc); |