]> 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)
committerZefan Li <lizefan@huawei.com>
Wed, 27 Apr 2016 10:55:16 +0000 (18:55 +0800)
commit 0c78789e3a030615c6650fde89546cadf40ec2cc upstream.

In case the reconnection attempt fails.

Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
[lizf: Backported to 3.4: add definition of variable xprt]
Signed-off-by: Zefan Li <lizefan@huawei.com>
net/sunrpc/xprtsock.c

index 31275e52c6670f1fc616df4e8ecab6155a45153f..d4a564fec093ef73740fe831c13c764b1b60fffa 100644 (file)
@@ -811,6 +811,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;
@@ -824,6 +825,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;