aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc/xprtsock.c
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2008-04-17 16:52:57 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2008-04-19 16:55:12 -0400
commit7c1d71cf56feebfb5b98219b9d11dfc3a2feca62 (patch)
tree5a073d987ec79900b2aff217a226c8c78e94b579 /net/sunrpc/xprtsock.c
parent636ac43318ce6939c1698fb67e714d421314ed71 (diff)
SUNRPC: Don't disconnect more than once if retransmitting NFSv4 requests
NFSv4 requires us to ensure that we break the TCP connection before we're allowed to retransmit a request. However in the case where we're retransmitting several requests that have been sent on the same connection, we need to ensure that we don't interfere with the attempt to reconnect and/or break the connection again once it has been established. We therefore introduce a 'connection' cookie that is bumped every time a connection is broken. This allows requests to track if they need to force a disconnection. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'net/sunrpc/xprtsock.c')
-rw-r--r--net/sunrpc/xprtsock.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
index 4a567a93e6ad..63d79e347c00 100644
--- a/net/sunrpc/xprtsock.c
+++ b/net/sunrpc/xprtsock.c
@@ -1142,6 +1142,7 @@ static void xs_tcp_state_change(struct sock *sk)
1142 break; 1142 break;
1143 case TCP_FIN_WAIT1: 1143 case TCP_FIN_WAIT1:
1144 /* The client initiated a shutdown of the socket */ 1144 /* The client initiated a shutdown of the socket */
1145 xprt->connect_cookie++;
1145 xprt->reestablish_timeout = 0; 1146 xprt->reestablish_timeout = 0;
1146 set_bit(XPRT_CLOSING, &xprt->state); 1147 set_bit(XPRT_CLOSING, &xprt->state);
1147 smp_mb__before_clear_bit(); 1148 smp_mb__before_clear_bit();
@@ -1154,6 +1155,7 @@ static void xs_tcp_state_change(struct sock *sk)
1154 set_bit(XPRT_CLOSING, &xprt->state); 1155 set_bit(XPRT_CLOSING, &xprt->state);
1155 xprt_force_disconnect(xprt); 1156 xprt_force_disconnect(xprt);
1156 case TCP_SYN_SENT: 1157 case TCP_SYN_SENT:
1158 xprt->connect_cookie++;
1157 case TCP_CLOSING: 1159 case TCP_CLOSING:
1158 /* 1160 /*
1159 * If the server closed down the connection, make sure that 1161 * If the server closed down the connection, make sure that