SUNRPC: Clear the connect flag when socket state is TCP_CLOSE_WAIT
authorTrond Myklebust <Trond.Myklebust@netapp.com>
Tue, 23 Oct 2012 15:35:47 +0000 (11:35 -0400)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Wed, 24 Oct 2012 14:44:49 +0000 (10:44 -0400)
This is needed to ensure that we call xprt_connect() upon the next
call to call_connect().

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Cc: stable@vger.kernel.org
Tested-by: Chris Perl <chris.perl@gmail.com>
net/sunrpc/xprtsock.c

index aaaadfbe36e9525a42a86e1f649bf66e59eb7274..6e6967d5400e61c526036ecd98ef041df1c40667 100644 (file)
@@ -1516,6 +1516,7 @@ static void xs_tcp_state_change(struct sock *sk)
        case TCP_CLOSE_WAIT:
                /* The server initiated a shutdown of the socket */
                xprt->connect_cookie++;
+               clear_bit(XPRT_CONNECTED, &xprt->state);
                xs_tcp_force_close(xprt);
        case TCP_CLOSING:
                /*