aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc/clnt.c
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2007-04-20 16:12:55 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-04-21 01:56:30 -0400
commit241c39b9ac4bf847013aa06cce6d4d61426a2006 (patch)
tree6455884e65288e64576555a27c06a8ee2f1f6371 /net/sunrpc/clnt.c
parent2b82f190c81bf1524447c021df4e9ce8ef379bd5 (diff)
RPC: Fix the TCP resend semantics for NFSv4
Fix a regression due to the patch "NFS: disconnect before retrying NFSv4 requests over TCP" The assumption made in xprt_transmit() that the condition "req->rq_bytes_sent == 0 and request is on the receive list" should imply that we're dealing with a retransmission is false. Firstly, it may simply happen that the socket send queue was full at the time the request was initially sent through xprt_transmit(). Secondly, doing this for each request that was retransmitted implies that we disconnect and reconnect for _every_ request that happened to be retransmitted irrespective of whether or not a disconnection has already occurred. Fix is to move this logic into the call_status request timeout handler. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'net/sunrpc/clnt.c')
-rw-r--r--net/sunrpc/clnt.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c
index 6d7221fe990a..396cdbe249d1 100644
--- a/net/sunrpc/clnt.c
+++ b/net/sunrpc/clnt.c
@@ -1046,6 +1046,8 @@ call_status(struct rpc_task *task)
1046 rpc_delay(task, 3*HZ); 1046 rpc_delay(task, 3*HZ);
1047 case -ETIMEDOUT: 1047 case -ETIMEDOUT:
1048 task->tk_action = call_timeout; 1048 task->tk_action = call_timeout;
1049 if (task->tk_client->cl_discrtry)
1050 xprt_disconnect(task->tk_xprt);
1049 break; 1051 break;
1050 case -ECONNREFUSED: 1052 case -ECONNREFUSED:
1051 case -ENOTCONN: 1053 case -ENOTCONN:
@@ -1169,6 +1171,8 @@ call_decode(struct rpc_task *task)
1169out_retry: 1171out_retry:
1170 req->rq_received = req->rq_private_buf.len = 0; 1172 req->rq_received = req->rq_private_buf.len = 0;
1171 task->tk_status = 0; 1173 task->tk_status = 0;
1174 if (task->tk_client->cl_discrtry)
1175 xprt_disconnect(task->tk_xprt);
1172} 1176}
1173 1177
1174/* 1178/*