diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2008-04-17 16:52:57 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2008-04-19 16:55:12 -0400 |
commit | 7c1d71cf56feebfb5b98219b9d11dfc3a2feca62 (patch) | |
tree | 5a073d987ec79900b2aff217a226c8c78e94b579 /net/sunrpc/clnt.c | |
parent | 636ac43318ce6939c1698fb67e714d421314ed71 (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/clnt.c')
-rw-r--r-- | net/sunrpc/clnt.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c index 3ae560464513..8773b4342c92 100644 --- a/net/sunrpc/clnt.c +++ b/net/sunrpc/clnt.c | |||
@@ -1120,7 +1120,8 @@ call_status(struct rpc_task *task) | |||
1120 | case -ETIMEDOUT: | 1120 | case -ETIMEDOUT: |
1121 | task->tk_action = call_timeout; | 1121 | task->tk_action = call_timeout; |
1122 | if (task->tk_client->cl_discrtry) | 1122 | if (task->tk_client->cl_discrtry) |
1123 | xprt_force_disconnect(task->tk_xprt); | 1123 | xprt_conditional_disconnect(task->tk_xprt, |
1124 | req->rq_connect_cookie); | ||
1124 | break; | 1125 | break; |
1125 | case -ECONNREFUSED: | 1126 | case -ECONNREFUSED: |
1126 | case -ENOTCONN: | 1127 | case -ENOTCONN: |
@@ -1245,7 +1246,8 @@ out_retry: | |||
1245 | if (task->tk_rqstp == req) { | 1246 | if (task->tk_rqstp == req) { |
1246 | req->rq_received = req->rq_rcv_buf.len = 0; | 1247 | req->rq_received = req->rq_rcv_buf.len = 0; |
1247 | if (task->tk_client->cl_discrtry) | 1248 | if (task->tk_client->cl_discrtry) |
1248 | xprt_force_disconnect(task->tk_xprt); | 1249 | xprt_conditional_disconnect(task->tk_xprt, |
1250 | req->rq_connect_cookie); | ||
1249 | } | 1251 | } |
1250 | } | 1252 | } |
1251 | 1253 | ||