diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2011-04-24 14:28:45 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2011-04-24 14:28:45 -0400 |
commit | 7494d00c7b826b6ceb79ec33892bd0ef59be5614 (patch) | |
tree | 1a8a6d056047135108ffc8ea311ccd80d1fd28fd /net/sunrpc | |
parent | fd954ae124e8a866e9cc1bc3de9a07be5492f608 (diff) |
SUNRPC: Allow RPC calls to return ETIMEDOUT instead of EIO
On occasion, it is useful for the NFS layer to distinguish between
soft timeouts and other EIO errors due to (say) encoding errors,
or authentication errors.
The following patch ensures that the default behaviour of the RPC
layer remains to return EIO on soft timeouts (until we have
audited all the callers).
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'net/sunrpc')
-rw-r--r-- | net/sunrpc/clnt.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c index e7a96e478f63..8d83f9d48713 100644 --- a/net/sunrpc/clnt.c +++ b/net/sunrpc/clnt.c | |||
@@ -1508,7 +1508,10 @@ call_timeout(struct rpc_task *task) | |||
1508 | if (clnt->cl_chatty) | 1508 | if (clnt->cl_chatty) |
1509 | printk(KERN_NOTICE "%s: server %s not responding, timed out\n", | 1509 | printk(KERN_NOTICE "%s: server %s not responding, timed out\n", |
1510 | clnt->cl_protname, clnt->cl_server); | 1510 | clnt->cl_protname, clnt->cl_server); |
1511 | rpc_exit(task, -EIO); | 1511 | if (task->tk_flags & RPC_TASK_TIMEOUT) |
1512 | rpc_exit(task, -ETIMEDOUT); | ||
1513 | else | ||
1514 | rpc_exit(task, -EIO); | ||
1512 | return; | 1515 | return; |
1513 | } | 1516 | } |
1514 | 1517 | ||