summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2007-11-06 18:28:53 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2008-01-30 02:05:26 -0500
commit7272dcd31d56580dee7693c21e369fd167e137fe (patch)
treea69f10501069ec89d8fb7188f89e7d1d19929488 /net
parente06799f958bf7f9f8fae15f0c6f519953fb0257c (diff)
downloadlwn-7272dcd31d56580dee7693c21e369fd167e137fe.tar.gz
lwn-7272dcd31d56580dee7693c21e369fd167e137fe.zip
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: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'net')
-rw-r--r--net/sunrpc/xprt.c1
-rw-r--r--net/sunrpc/xprtsock.c3
2 files changed, 1 insertions, 3 deletions
diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c
index a3af02168af1..80742995e02e 100644
--- a/net/sunrpc/xprt.c
+++ b/net/sunrpc/xprt.c
@@ -568,7 +568,6 @@ static void xprt_autoclose(struct work_struct *work)
struct rpc_xprt *xprt =
container_of(work, struct rpc_xprt, task_cleanup);
- xprt_disconnect(xprt);
xprt->ops->close(xprt);
clear_bit(XPRT_CLOSE_WAIT, &xprt->state);
xprt_release_write(xprt, NULL);
diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
index a4c06900f398..9b06b8b2a112 100644
--- a/net/sunrpc/xprtsock.c
+++ b/net/sunrpc/xprtsock.c
@@ -774,10 +774,10 @@ static void xs_close(struct rpc_xprt *xprt)
sock_release(sock);
clear_close_wait:
smp_mb__before_clear_bit();
- clear_bit(XPRT_CONNECTED, &xprt->state);
clear_bit(XPRT_CLOSE_WAIT, &xprt->state);
clear_bit(XPRT_CLOSING, &xprt->state);
smp_mb__after_clear_bit();
+ xprt_disconnect(xprt);
}
/**
@@ -793,7 +793,6 @@ static void xs_destroy(struct rpc_xprt *xprt)
cancel_rearming_delayed_work(&transport->connect_worker);
- xprt_disconnect(xprt);
xs_close(xprt);
xs_free_peer_addresses(xprt);
kfree(xprt->slot);