Commit d84dd3fb authored by Trond Myklebust's avatar Trond Myklebust

SUNRPC: Don't let RPC_SOFTCONN tasks time out if the transport is connected

If the transport is still connected, then we do want to allow
RPC_SOFTCONN tasks to retry. They should time out if and only if
the connection is broken.
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@hammerspace.com>
parent 0cb98abb
...@@ -2311,6 +2311,15 @@ call_status(struct rpc_task *task) ...@@ -2311,6 +2311,15 @@ call_status(struct rpc_task *task)
rpc_exit(task, status); rpc_exit(task, status);
} }
static bool
rpc_check_connected(const struct rpc_rqst *req)
{
/* No allocated request or transport? return true */
if (!req || !req->rq_xprt)
return true;
return xprt_connected(req->rq_xprt);
}
static void static void
rpc_check_timeout(struct rpc_task *task) rpc_check_timeout(struct rpc_task *task)
{ {
...@@ -2322,10 +2331,11 @@ rpc_check_timeout(struct rpc_task *task) ...@@ -2322,10 +2331,11 @@ rpc_check_timeout(struct rpc_task *task)
dprintk("RPC: %5u call_timeout (major)\n", task->tk_pid); dprintk("RPC: %5u call_timeout (major)\n", task->tk_pid);
task->tk_timeouts++; task->tk_timeouts++;
if (RPC_IS_SOFTCONN(task)) { if (RPC_IS_SOFTCONN(task) && !rpc_check_connected(task->tk_rqstp)) {
rpc_exit(task, -ETIMEDOUT); rpc_exit(task, -ETIMEDOUT);
return; return;
} }
if (RPC_IS_SOFT(task)) { if (RPC_IS_SOFT(task)) {
if (clnt->cl_chatty) { if (clnt->cl_chatty) {
printk(KERN_NOTICE "%s: server %s not responding, timed out\n", printk(KERN_NOTICE "%s: server %s not responding, timed out\n",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment