diff options
author | Chuck Lever <cel@citi.umich.edu> | 2005-08-11 16:25:08 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2005-09-23 12:38:03 -0400 |
commit | 23475d66bd8600e0c5353f86c1b74f68df27bdb5 (patch) | |
tree | 040565dacc08e99a86e2dd716b348f74e12e08db /net/sunrpc/xprt.c | |
parent | 9aa48b7e270d13c8781414dce081a42cae20a80d (diff) |
[PATCH] RPC: Report connection errors properly when mounting with "soft"
Fix up xprt_connect_status: the soft timeout logic was clobbering tk_status,
so TCP connect errors were not properly reported on soft mounts.
Test-plan:
Destructive testing (unplugging the network temporarily). Connectathon
with UDP and TCP.
Version: Thu, 11 Aug 2005 16:01:28 -0400
Signed-off-by: Chuck Lever <cel@netapp.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'net/sunrpc/xprt.c')
-rw-r--r-- | net/sunrpc/xprt.c | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c index 3c654e06b084..b28ea0cc0cb7 100644 --- a/net/sunrpc/xprt.c +++ b/net/sunrpc/xprt.c | |||
@@ -592,24 +592,33 @@ xprt_connect_status(struct rpc_task *task) | |||
592 | return; | 592 | return; |
593 | } | 593 | } |
594 | 594 | ||
595 | /* if soft mounted, just cause this RPC to fail */ | ||
596 | if (RPC_IS_SOFT(task)) | ||
597 | task->tk_status = -EIO; | ||
598 | |||
599 | switch (task->tk_status) { | 595 | switch (task->tk_status) { |
600 | case -ECONNREFUSED: | 596 | case -ECONNREFUSED: |
601 | case -ECONNRESET: | 597 | case -ECONNRESET: |
598 | dprintk("RPC: %4d xprt_connect_status: server %s refused connection\n", | ||
599 | task->tk_pid, task->tk_client->cl_server); | ||
600 | break; | ||
602 | case -ENOTCONN: | 601 | case -ENOTCONN: |
603 | return; | 602 | dprintk("RPC: %4d xprt_connect_status: connection broken\n", |
603 | task->tk_pid); | ||
604 | break; | ||
604 | case -ETIMEDOUT: | 605 | case -ETIMEDOUT: |
605 | dprintk("RPC: %4d xprt_connect_status: timed out\n", | 606 | dprintk("RPC: %4d xprt_connect_status: connect attempt timed out\n", |
606 | task->tk_pid); | 607 | task->tk_pid); |
607 | break; | 608 | break; |
608 | default: | 609 | default: |
609 | printk(KERN_ERR "RPC: error %d connecting to server %s\n", | 610 | dprintk("RPC: %4d xprt_connect_status: error %d connecting to server %s\n", |
610 | -task->tk_status, task->tk_client->cl_server); | 611 | task->tk_pid, -task->tk_status, task->tk_client->cl_server); |
612 | xprt_release_write(xprt, task); | ||
613 | task->tk_status = -EIO; | ||
614 | return; | ||
615 | } | ||
616 | |||
617 | /* if soft mounted, just cause this RPC to fail */ | ||
618 | if (RPC_IS_SOFT(task)) { | ||
619 | xprt_release_write(xprt, task); | ||
620 | task->tk_status = -EIO; | ||
611 | } | 621 | } |
612 | xprt_release_write(xprt, task); | ||
613 | } | 622 | } |
614 | 623 | ||
615 | /* | 624 | /* |