Commit e1806c7b authored by Trond Myklebust's avatar Trond Myklebust

SUNRPC: Move reset of TCP state variables into the reconnect code

Rather than resetting state variables in socket state_change() callback,
do it in the sunrpc TCP connect function itself.
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@hammerspace.com>
parent d1109aa5
...@@ -1600,13 +1600,6 @@ static void xs_tcp_state_change(struct sock *sk) ...@@ -1600,13 +1600,6 @@ static void xs_tcp_state_change(struct sock *sk)
case TCP_ESTABLISHED: case TCP_ESTABLISHED:
spin_lock(&xprt->transport_lock); spin_lock(&xprt->transport_lock);
if (!xprt_test_and_set_connected(xprt)) { if (!xprt_test_and_set_connected(xprt)) {
/* Reset TCP record info */
transport->recv.offset = 0;
transport->recv.len = 0;
transport->recv.copied = 0;
transport->recv.flags =
TCP_RCV_COPY_FRAGHDR | TCP_RCV_COPY_XID;
xprt->connect_cookie++; xprt->connect_cookie++;
clear_bit(XPRT_SOCK_CONNECTING, &transport->sock_state); clear_bit(XPRT_SOCK_CONNECTING, &transport->sock_state);
xprt_clear_connecting(xprt); xprt_clear_connecting(xprt);
...@@ -2386,6 +2379,12 @@ static int xs_tcp_finish_connecting(struct rpc_xprt *xprt, struct socket *sock) ...@@ -2386,6 +2379,12 @@ static int xs_tcp_finish_connecting(struct rpc_xprt *xprt, struct socket *sock)
xs_set_memalloc(xprt); xs_set_memalloc(xprt);
/* Reset TCP record info */
transport->recv.offset = 0;
transport->recv.len = 0;
transport->recv.copied = 0;
transport->recv.flags = TCP_RCV_COPY_FRAGHDR | TCP_RCV_COPY_XID;
/* Tell the socket layer to start connecting... */ /* Tell the socket layer to start connecting... */
xprt->stat.connect_count++; xprt->stat.connect_count++;
xprt->stat.connect_start = jiffies; xprt->stat.connect_start = jiffies;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment