Commit 3913c78c authored by Trond Myklebust's avatar Trond Myklebust

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: default avatarTrond Myklebust <trond.myklebust@primarydata.com>
parent 4dda9c8a
...@@ -1826,6 +1826,7 @@ call_connect_status(struct rpc_task *task) ...@@ -1826,6 +1826,7 @@ call_connect_status(struct rpc_task *task)
case -ECONNABORTED: case -ECONNABORTED:
case -ENETUNREACH: case -ENETUNREACH:
case -EHOSTUNREACH: case -EHOSTUNREACH:
case -EADDRINUSE:
case -ENOBUFS: case -ENOBUFS:
case -EPIPE: case -EPIPE:
if (RPC_IS_SOFTCONN(task)) if (RPC_IS_SOFTCONN(task))
...@@ -1934,6 +1935,7 @@ call_transmit_status(struct rpc_task *task) ...@@ -1934,6 +1935,7 @@ call_transmit_status(struct rpc_task *task)
} }
case -ECONNRESET: case -ECONNRESET:
case -ECONNABORTED: case -ECONNABORTED:
case -EADDRINUSE:
case -ENOTCONN: case -ENOTCONN:
case -ENOBUFS: case -ENOBUFS:
case -EPIPE: case -EPIPE:
...@@ -2053,6 +2055,7 @@ call_status(struct rpc_task *task) ...@@ -2053,6 +2055,7 @@ call_status(struct rpc_task *task)
case -ECONNRESET: case -ECONNRESET:
case -ECONNABORTED: case -ECONNABORTED:
rpc_force_rebind(clnt); rpc_force_rebind(clnt);
case -EADDRINUSE:
case -ENOBUFS: case -ENOBUFS:
rpc_delay(task, 3*HZ); rpc_delay(task, 3*HZ);
case -EPIPE: case -EPIPE:
......
...@@ -721,6 +721,7 @@ static int xs_tcp_send_request(struct rpc_task *task) ...@@ -721,6 +721,7 @@ static int xs_tcp_send_request(struct rpc_task *task)
xs_tcp_shutdown(xprt); xs_tcp_shutdown(xprt);
case -ECONNREFUSED: case -ECONNREFUSED:
case -ENOTCONN: case -ENOTCONN:
case -EADDRINUSE:
case -EPIPE: case -EPIPE:
clear_bit(SOCK_ASYNC_NOSPACE, &transport->sock->flags); clear_bit(SOCK_ASYNC_NOSPACE, &transport->sock->flags);
} }
...@@ -2299,6 +2300,7 @@ static void xs_tcp_setup_socket(struct work_struct *work) ...@@ -2299,6 +2300,7 @@ static void xs_tcp_setup_socket(struct work_struct *work)
case -ECONNREFUSED: case -ECONNREFUSED:
case -ECONNRESET: case -ECONNRESET:
case -ENETUNREACH: case -ENETUNREACH:
case -EADDRINUSE:
case -ENOBUFS: case -ENOBUFS:
/* retry with existing socket, after a delay */ /* retry with existing socket, after a delay */
goto out; goto out;
......
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