aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@primarydata.com>2015-02-08 21:44:04 -0500
committerTrond Myklebust <trond.myklebust@primarydata.com>2015-02-08 21:47:27 -0500
commit3913c78c3ab61500ddf7c2c9617cc4f8e2c583e0 (patch)
tree9b77984e4d37c5a6aa79d3adcd32866604163e3b /net
parent4dda9c8a5e34773b290c6b5938ccb36e7fcdf35c (diff)
SUNRPC: Handle EADDRINUSE on connect
Now that we're setting SO_REUSEPORT, we still need to handle the case where a connect() is attempted, but the old socket is still lingering. Essentially, all we want to do here is handle the error by waiting a few seconds and then retrying. Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Diffstat (limited to 'net')
-rw-r--r--net/sunrpc/clnt.c3
-rw-r--r--net/sunrpc/xprtsock.c2
2 files changed, 5 insertions, 0 deletions
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c
index 3f5d4d48f0cb..612aa73bbc60 100644
--- a/net/sunrpc/clnt.c
+++ b/net/sunrpc/clnt.c
@@ -1826,6 +1826,7 @@ call_connect_status(struct rpc_task *task)
1826 case -ECONNABORTED: 1826 case -ECONNABORTED:
1827 case -ENETUNREACH: 1827 case -ENETUNREACH:
1828 case -EHOSTUNREACH: 1828 case -EHOSTUNREACH:
1829 case -EADDRINUSE:
1829 case -ENOBUFS: 1830 case -ENOBUFS:
1830 case -EPIPE: 1831 case -EPIPE:
1831 if (RPC_IS_SOFTCONN(task)) 1832 if (RPC_IS_SOFTCONN(task))
@@ -1934,6 +1935,7 @@ call_transmit_status(struct rpc_task *task)
1934 } 1935 }
1935 case -ECONNRESET: 1936 case -ECONNRESET:
1936 case -ECONNABORTED: 1937 case -ECONNABORTED:
1938 case -EADDRINUSE:
1937 case -ENOTCONN: 1939 case -ENOTCONN:
1938 case -ENOBUFS: 1940 case -ENOBUFS:
1939 case -EPIPE: 1941 case -EPIPE:
@@ -2053,6 +2055,7 @@ call_status(struct rpc_task *task)
2053 case -ECONNRESET: 2055 case -ECONNRESET:
2054 case -ECONNABORTED: 2056 case -ECONNABORTED:
2055 rpc_force_rebind(clnt); 2057 rpc_force_rebind(clnt);
2058 case -EADDRINUSE:
2056 case -ENOBUFS: 2059 case -ENOBUFS:
2057 rpc_delay(task, 3*HZ); 2060 rpc_delay(task, 3*HZ);
2058 case -EPIPE: 2061 case -EPIPE:
diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
index 484c5040436a..20f25a837e06 100644
--- a/net/sunrpc/xprtsock.c
+++ b/net/sunrpc/xprtsock.c
@@ -721,6 +721,7 @@ static int xs_tcp_send_request(struct rpc_task *task)
721 xs_tcp_shutdown(xprt); 721 xs_tcp_shutdown(xprt);
722 case -ECONNREFUSED: 722 case -ECONNREFUSED:
723 case -ENOTCONN: 723 case -ENOTCONN:
724 case -EADDRINUSE:
724 case -EPIPE: 725 case -EPIPE:
725 clear_bit(SOCK_ASYNC_NOSPACE, &transport->sock->flags); 726 clear_bit(SOCK_ASYNC_NOSPACE, &transport->sock->flags);
726 } 727 }
@@ -2299,6 +2300,7 @@ static void xs_tcp_setup_socket(struct work_struct *work)
2299 case -ECONNREFUSED: 2300 case -ECONNREFUSED:
2300 case -ECONNRESET: 2301 case -ECONNRESET:
2301 case -ENETUNREACH: 2302 case -ENETUNREACH:
2303 case -EADDRINUSE:
2302 case -ENOBUFS: 2304 case -ENOBUFS:
2303 /* retry with existing socket, after a delay */ 2305 /* retry with existing socket, after a delay */
2304 goto out; 2306 goto out;