Commit 7272dcd3 authored by Trond Myklebust's avatar Trond Myklebust

SUNRPC: xprt_autoclose() should not call xprt_disconnect()

The transport layer should do that itself whenever appropriate.

Note that the RDMA transport already assumes that it needs to call
xprt_disconnect in xprt_rdma_close().
For TCP sockets, we want to call xprt_disconnect() only after the
connection has been closed by both ends.
Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent e06799f9
...@@ -568,7 +568,6 @@ static void xprt_autoclose(struct work_struct *work) ...@@ -568,7 +568,6 @@ static void xprt_autoclose(struct work_struct *work)
struct rpc_xprt *xprt = struct rpc_xprt *xprt =
container_of(work, struct rpc_xprt, task_cleanup); container_of(work, struct rpc_xprt, task_cleanup);
xprt_disconnect(xprt);
xprt->ops->close(xprt); xprt->ops->close(xprt);
clear_bit(XPRT_CLOSE_WAIT, &xprt->state); clear_bit(XPRT_CLOSE_WAIT, &xprt->state);
xprt_release_write(xprt, NULL); xprt_release_write(xprt, NULL);
......
...@@ -774,10 +774,10 @@ static void xs_close(struct rpc_xprt *xprt) ...@@ -774,10 +774,10 @@ static void xs_close(struct rpc_xprt *xprt)
sock_release(sock); sock_release(sock);
clear_close_wait: clear_close_wait:
smp_mb__before_clear_bit(); smp_mb__before_clear_bit();
clear_bit(XPRT_CONNECTED, &xprt->state);
clear_bit(XPRT_CLOSE_WAIT, &xprt->state); clear_bit(XPRT_CLOSE_WAIT, &xprt->state);
clear_bit(XPRT_CLOSING, &xprt->state); clear_bit(XPRT_CLOSING, &xprt->state);
smp_mb__after_clear_bit(); smp_mb__after_clear_bit();
xprt_disconnect(xprt);
} }
/** /**
...@@ -793,7 +793,6 @@ static void xs_destroy(struct rpc_xprt *xprt) ...@@ -793,7 +793,6 @@ static void xs_destroy(struct rpc_xprt *xprt)
cancel_rearming_delayed_work(&transport->connect_worker); cancel_rearming_delayed_work(&transport->connect_worker);
xprt_disconnect(xprt);
xs_close(xprt); xs_close(xprt);
xs_free_peer_addresses(xprt); xs_free_peer_addresses(xprt);
kfree(xprt->slot); kfree(xprt->slot);
......
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