aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2009-03-11 14:38:01 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2009-03-11 14:38:01 -0400
commit8a2cec295f4499cc9d4452e9b02d4ed071bb42d3 (patch)
tree148f1658cb923a2faafdb1e993dd63832c860eb1 /net/sunrpc
parent2a4919919a97911b0aa4b9f5ac1eab90ba87652b (diff)
SUNRPC: Delay, then retry on connection errors.
Enforce the comment in xs_tcp_connect_worker4/xs_tcp_connect_worker6 that we should delay, then retry on certain connection errors. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'net/sunrpc')
-rw-r--r--net/sunrpc/xprtsock.c34
1 files changed, 16 insertions, 18 deletions
diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
index 8e58b0b5460b..9f3e615d3e09 100644
--- a/net/sunrpc/xprtsock.c
+++ b/net/sunrpc/xprtsock.c
@@ -1722,20 +1722,19 @@ static void xs_tcp_connect_worker4(struct work_struct *work)
1722 xprt, -status, xprt_connected(xprt), 1722 xprt, -status, xprt_connected(xprt),
1723 sock->sk->sk_state); 1723 sock->sk->sk_state);
1724 switch (status) { 1724 switch (status) {
1725 case -ECONNREFUSED:
1726 case -ECONNRESET:
1727 case -ENETUNREACH:
1728 /* retry with existing socket, after a delay */
1725 case 0: 1729 case 0:
1726 case -EINPROGRESS: 1730 case -EINPROGRESS:
1727 case -EALREADY: 1731 case -EALREADY:
1728 goto out_clear; 1732 goto out_clear;
1729 case -ECONNREFUSED:
1730 case -ECONNRESET:
1731 /* retry with existing socket, after a delay */
1732 break;
1733 default:
1734 /* get rid of existing socket, and retry */
1735 xs_tcp_shutdown(xprt);
1736 printk("%s: connect returned unhandled error %d\n",
1737 __func__, status);
1738 } 1733 }
1734 /* get rid of existing socket, and retry */
1735 xs_tcp_shutdown(xprt);
1736 printk("%s: connect returned unhandled error %d\n",
1737 __func__, status);
1739 status = -EAGAIN; 1738 status = -EAGAIN;
1740out: 1739out:
1741 xprt_wake_pending_tasks(xprt, status); 1740 xprt_wake_pending_tasks(xprt, status);
@@ -1783,20 +1782,19 @@ static void xs_tcp_connect_worker6(struct work_struct *work)
1783 dprintk("RPC: %p connect status %d connected %d sock state %d\n", 1782 dprintk("RPC: %p connect status %d connected %d sock state %d\n",
1784 xprt, -status, xprt_connected(xprt), sock->sk->sk_state); 1783 xprt, -status, xprt_connected(xprt), sock->sk->sk_state);
1785 switch (status) { 1784 switch (status) {
1785 case -ECONNREFUSED:
1786 case -ECONNRESET:
1787 case -ENETUNREACH:
1788 /* retry with existing socket, after a delay */
1786 case 0: 1789 case 0:
1787 case -EINPROGRESS: 1790 case -EINPROGRESS:
1788 case -EALREADY: 1791 case -EALREADY:
1789 goto out_clear; 1792 goto out_clear;
1790 case -ECONNREFUSED:
1791 case -ECONNRESET:
1792 /* retry with existing socket, after a delay */
1793 break;
1794 default:
1795 /* get rid of existing socket, and retry */
1796 xs_tcp_shutdown(xprt);
1797 printk("%s: connect returned unhandled error %d\n",
1798 __func__, status);
1799 } 1793 }
1794 /* get rid of existing socket, and retry */
1795 xs_tcp_shutdown(xprt);
1796 printk("%s: connect returned unhandled error %d\n",
1797 __func__, status);
1800 status = -EAGAIN; 1798 status = -EAGAIN;
1801out: 1799out:
1802 xprt_wake_pending_tasks(xprt, status); 1800 xprt_wake_pending_tasks(xprt, status);