diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2009-03-11 14:38:00 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2009-03-11 14:38:00 -0400 |
commit | 2a4919919a97911b0aa4b9f5ac1eab90ba87652b (patch) | |
tree | c12eb42c34f0d0b79130ae93ebd56159e8366ee8 /net/sunrpc/clnt.c | |
parent | 482f32e65d31cbf88d08306fa5d397cc945c3c26 (diff) |
SUNRPC: Return EAGAIN instead of ENOTCONN when waking up xprt->pending
While we should definitely return socket errors to the task that is
currently trying to send data, there is no need to propagate the same error
to all the other tasks on xprt->pending. Doing so actually slows down
recovery, since it causes more than one tasks to attempt socket recovery.
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'net/sunrpc/clnt.c')
-rw-r--r-- | net/sunrpc/clnt.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c index 145715b53115..5abab094441f 100644 --- a/net/sunrpc/clnt.c +++ b/net/sunrpc/clnt.c | |||
@@ -1032,27 +1032,20 @@ call_connect_status(struct rpc_task *task) | |||
1032 | dprint_status(task); | 1032 | dprint_status(task); |
1033 | 1033 | ||
1034 | task->tk_status = 0; | 1034 | task->tk_status = 0; |
1035 | if (status >= 0) { | 1035 | if (status >= 0 || status == -EAGAIN) { |
1036 | clnt->cl_stats->netreconn++; | 1036 | clnt->cl_stats->netreconn++; |
1037 | task->tk_action = call_transmit; | 1037 | task->tk_action = call_transmit; |
1038 | return; | 1038 | return; |
1039 | } | 1039 | } |
1040 | 1040 | ||
1041 | /* Something failed: remote service port may have changed */ | ||
1042 | rpc_force_rebind(clnt); | ||
1043 | |||
1044 | switch (status) { | 1041 | switch (status) { |
1045 | case -ENOTCONN: | ||
1046 | case -EAGAIN: | ||
1047 | task->tk_action = call_bind; | ||
1048 | if (!RPC_IS_SOFT(task)) | ||
1049 | return; | ||
1050 | /* if soft mounted, test if we've timed out */ | 1042 | /* if soft mounted, test if we've timed out */ |
1051 | case -ETIMEDOUT: | 1043 | case -ETIMEDOUT: |
1052 | task->tk_action = call_timeout; | 1044 | task->tk_action = call_timeout; |
1053 | return; | 1045 | break; |
1046 | default: | ||
1047 | rpc_exit(task, -EIO); | ||
1054 | } | 1048 | } |
1055 | rpc_exit(task, -EIO); | ||
1056 | } | 1049 | } |
1057 | 1050 | ||
1058 | /* | 1051 | /* |