aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2009-03-11 14:37:58 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2009-03-11 14:37:58 -0400
commit670f94573104b4a25525d3fcdcd6496c678df172 (patch)
tree3beaadb8ee2841972c0e719c67c64e1cc27bb7ea /net/sunrpc
parent15f081ca8ddfe150fb639c591b18944a539da0fc (diff)
SUNRPC: Ensure we set XPRT_CLOSING only after we've sent a tcp FIN...
...so that we can distinguish between when we need to shutdown and when we don't. Also remove the call to xs_tcp_shutdown() from xs_tcp_connect(), since xprt_connect() makes the same test. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'net/sunrpc')
-rw-r--r--net/sunrpc/xprtsock.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
index 1127eb934136..cb4bd93b9211 100644
--- a/net/sunrpc/xprtsock.c
+++ b/net/sunrpc/xprtsock.c
@@ -1180,7 +1180,6 @@ static void xs_tcp_state_change(struct sock *sk)
1180 break; 1180 break;
1181 case TCP_CLOSE_WAIT: 1181 case TCP_CLOSE_WAIT:
1182 /* The server initiated a shutdown of the socket */ 1182 /* The server initiated a shutdown of the socket */
1183 set_bit(XPRT_CLOSING, &xprt->state);
1184 xprt_force_disconnect(xprt); 1183 xprt_force_disconnect(xprt);
1185 case TCP_SYN_SENT: 1184 case TCP_SYN_SENT:
1186 xprt->connect_cookie++; 1185 xprt->connect_cookie++;
@@ -1193,6 +1192,7 @@ static void xs_tcp_state_change(struct sock *sk)
1193 xprt->reestablish_timeout = XS_TCP_INIT_REEST_TO; 1192 xprt->reestablish_timeout = XS_TCP_INIT_REEST_TO;
1194 break; 1193 break;
1195 case TCP_LAST_ACK: 1194 case TCP_LAST_ACK:
1195 set_bit(XPRT_CLOSING, &xprt->state);
1196 smp_mb__before_clear_bit(); 1196 smp_mb__before_clear_bit();
1197 clear_bit(XPRT_CONNECTED, &xprt->state); 1197 clear_bit(XPRT_CONNECTED, &xprt->state);
1198 smp_mb__after_clear_bit(); 1198 smp_mb__after_clear_bit();
@@ -1836,9 +1836,6 @@ static void xs_tcp_connect(struct rpc_task *task)
1836{ 1836{
1837 struct rpc_xprt *xprt = task->tk_xprt; 1837 struct rpc_xprt *xprt = task->tk_xprt;
1838 1838
1839 /* Initiate graceful shutdown of the socket if not already done */
1840 if (test_bit(XPRT_CONNECTED, &xprt->state))
1841 xs_tcp_shutdown(xprt);
1842 /* Exit if we need to wait for socket shutdown to complete */ 1839 /* Exit if we need to wait for socket shutdown to complete */
1843 if (test_bit(XPRT_CLOSING, &xprt->state)) 1840 if (test_bit(XPRT_CLOSING, &xprt->state))
1844 return; 1841 return;