aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2013-03-04 17:29:33 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2013-03-25 12:04:10 -0400
commit3ed5e2a2c394df4e03a680842c2d07a8680f133b (patch)
tree83050928d116f2079147f6de8c77860a4ec76f27 /net
parent1166fde6a923c30f4351515b6a9a1efc513e7d00 (diff)
SUNRPC: Report network/connection errors correctly for SOFTCONN rpc tasks
In the case of a SOFTCONN rpc task, we really want to ensure that it reports errors like ENETUNREACH back to the caller. Currently, only some of these errors are being reported back (connect errors are not), and they are being converted by the RPC layer into EIO. Reported-by: Jan Engelhardt <jengelh@inai.de> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'net')
-rw-r--r--net/sunrpc/clnt.c24
-rw-r--r--net/sunrpc/xprtsock.c8
2 files changed, 18 insertions, 14 deletions
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c
index dcc446e7fbf6..b95a0a2d5eea 100644
--- a/net/sunrpc/clnt.c
+++ b/net/sunrpc/clnt.c
@@ -1644,22 +1644,26 @@ call_connect_status(struct rpc_task *task)
1644 1644
1645 dprint_status(task); 1645 dprint_status(task);
1646 1646
1647 task->tk_status = 0;
1648 if (status >= 0 || status == -EAGAIN) {
1649 clnt->cl_stats->netreconn++;
1650 task->tk_action = call_transmit;
1651 return;
1652 }
1653
1654 trace_rpc_connect_status(task, status); 1647 trace_rpc_connect_status(task, status);
1655 switch (status) { 1648 switch (status) {
1656 /* if soft mounted, test if we've timed out */ 1649 /* if soft mounted, test if we've timed out */
1657 case -ETIMEDOUT: 1650 case -ETIMEDOUT:
1658 task->tk_action = call_timeout; 1651 task->tk_action = call_timeout;
1659 break; 1652 return;
1660 default: 1653 case -ECONNREFUSED:
1661 rpc_exit(task, -EIO); 1654 case -ECONNRESET:
1655 case -ENETUNREACH:
1656 if (RPC_IS_SOFTCONN(task))
1657 break;
1658 /* retry with existing socket, after a delay */
1659 case 0:
1660 case -EAGAIN:
1661 task->tk_status = 0;
1662 clnt->cl_stats->netreconn++;
1663 task->tk_action = call_transmit;
1664 return;
1662 } 1665 }
1666 rpc_exit(task, status);
1663} 1667}
1664 1668
1665/* 1669/*
diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
index c1d8476b7692..3081620cb02c 100644
--- a/net/sunrpc/xprtsock.c
+++ b/net/sunrpc/xprtsock.c
@@ -2202,10 +2202,6 @@ static void xs_tcp_setup_socket(struct work_struct *work)
2202 */ 2202 */
2203 xs_tcp_force_close(xprt); 2203 xs_tcp_force_close(xprt);
2204 break; 2204 break;
2205 case -ECONNREFUSED:
2206 case -ECONNRESET:
2207 case -ENETUNREACH:
2208 /* retry with existing socket, after a delay */
2209 case 0: 2205 case 0:
2210 case -EINPROGRESS: 2206 case -EINPROGRESS:
2211 case -EALREADY: 2207 case -EALREADY:
@@ -2216,6 +2212,10 @@ static void xs_tcp_setup_socket(struct work_struct *work)
2216 /* Happens, for instance, if the user specified a link 2212 /* Happens, for instance, if the user specified a link
2217 * local IPv6 address without a scope-id. 2213 * local IPv6 address without a scope-id.
2218 */ 2214 */
2215 case -ECONNREFUSED:
2216 case -ECONNRESET:
2217 case -ENETUNREACH:
2218 /* retry with existing socket, after a delay */
2219 goto out; 2219 goto out;
2220 } 2220 }
2221out_eagain: 2221out_eagain: