]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
SUNRPC: xs_reset_transport must mark the connection as disconnected
authorTrond Myklebust <trond.myklebust@primarydata.com>
Sat, 29 Aug 2015 20:36:30 +0000 (13:36 -0700)
committerWilly Tarreau <w@1wt.eu>
Sat, 5 Dec 2015 23:49:08 +0000 (00:49 +0100)
commit 0c78789e3a030615c6650fde89546cadf40ec2cc upstream.

In case the reconnection attempt fails.

Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
[bwh: Backported to 3.2: add local variable xprt]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
(cherry picked from commit 9434e4855e90d2af3751cd93b47b4a3e40bc2dc1)

Signed-off-by: Willy Tarreau <w@1wt.eu>
net/sunrpc/xprtsock.c

index d37f07c8179fa9da4e466327fe836c2e168ebd25..ec21612bb40fc80e82b2ccb81fe6ef446a4d4542 100644 (file)
@@ -734,6 +734,7 @@ static void xs_reset_transport(struct sock_xprt *transport)
 {
        struct socket *sock = transport->sock;
        struct sock *sk = transport->inet;
+       struct rpc_xprt *xprt = &transport->xprt;
 
        if (sk == NULL)
                return;
@@ -747,6 +748,7 @@ static void xs_reset_transport(struct sock_xprt *transport)
        sk->sk_user_data = NULL;
 
        xs_restore_old_callbacks(transport, sk);
+       xprt_clear_connected(xprt);
        write_unlock_bh(&sk->sk_callback_lock);
 
        sk->sk_no_check = 0;