Commit 27219fc0 authored by Trond Myklebust's avatar Trond Myklebust Committed by Jiri Slaby

SUNRPC: Ensure that we handle ENOBUFS errors correctly.

commit 3601c4a9 upstream.

Currently, an ENOBUFS error will result in a fatal error for the RPC
call. Normally, we will just want to wait and then retry.
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@primarydata.com>
Acked-by: default avatarNeilBrown <neilb@suse.de>
Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
parent 94feca62
...@@ -1642,6 +1642,7 @@ call_bind_status(struct rpc_task *task) ...@@ -1642,6 +1642,7 @@ call_bind_status(struct rpc_task *task)
case -EHOSTDOWN: case -EHOSTDOWN:
case -EHOSTUNREACH: case -EHOSTUNREACH:
case -ENETUNREACH: case -ENETUNREACH:
case -ENOBUFS:
case -EPIPE: case -EPIPE:
dprintk("RPC: %5u remote rpcbind unreachable: %d\n", dprintk("RPC: %5u remote rpcbind unreachable: %d\n",
task->tk_pid, task->tk_status); task->tk_pid, task->tk_status);
...@@ -1707,6 +1708,7 @@ call_connect_status(struct rpc_task *task) ...@@ -1707,6 +1708,7 @@ call_connect_status(struct rpc_task *task)
case -ECONNABORTED: case -ECONNABORTED:
case -ENETUNREACH: case -ENETUNREACH:
case -EHOSTUNREACH: case -EHOSTUNREACH:
case -ENOBUFS:
if (RPC_IS_SOFTCONN(task)) if (RPC_IS_SOFTCONN(task))
break; break;
/* retry with existing socket, after a delay */ /* retry with existing socket, after a delay */
...@@ -1810,6 +1812,7 @@ call_transmit_status(struct rpc_task *task) ...@@ -1810,6 +1812,7 @@ call_transmit_status(struct rpc_task *task)
case -ECONNRESET: case -ECONNRESET:
case -ECONNABORTED: case -ECONNABORTED:
case -ENOTCONN: case -ENOTCONN:
case -ENOBUFS:
case -EPIPE: case -EPIPE:
rpc_task_force_reencode(task); rpc_task_force_reencode(task);
} }
...@@ -1922,6 +1925,7 @@ call_status(struct rpc_task *task) ...@@ -1922,6 +1925,7 @@ call_status(struct rpc_task *task)
case -ECONNRESET: case -ECONNRESET:
case -ECONNABORTED: case -ECONNABORTED:
rpc_force_rebind(clnt); rpc_force_rebind(clnt);
case -ENOBUFS:
rpc_delay(task, 3*HZ); rpc_delay(task, 3*HZ);
case -EPIPE: case -EPIPE:
case -ENOTCONN: case -ENOTCONN:
......
...@@ -588,6 +588,7 @@ static int xs_local_send_request(struct rpc_task *task) ...@@ -588,6 +588,7 @@ static int xs_local_send_request(struct rpc_task *task)
} }
switch (status) { switch (status) {
case -ENOBUFS:
case -EAGAIN: case -EAGAIN:
status = xs_nospace(task); status = xs_nospace(task);
break; break;
...@@ -655,6 +656,7 @@ static int xs_udp_send_request(struct rpc_task *task) ...@@ -655,6 +656,7 @@ static int xs_udp_send_request(struct rpc_task *task)
dprintk("RPC: sendmsg returned unrecognized error %d\n", dprintk("RPC: sendmsg returned unrecognized error %d\n",
-status); -status);
case -ENETUNREACH: case -ENETUNREACH:
case -ENOBUFS:
case -EPIPE: case -EPIPE:
case -ECONNREFUSED: case -ECONNREFUSED:
/* When the server has died, an ICMP port unreachable message /* When the server has died, an ICMP port unreachable message
...@@ -752,6 +754,7 @@ static int xs_tcp_send_request(struct rpc_task *task) ...@@ -752,6 +754,7 @@ static int xs_tcp_send_request(struct rpc_task *task)
status = -ENOTCONN; status = -ENOTCONN;
/* Should we call xs_close() here? */ /* Should we call xs_close() here? */
break; break;
case -ENOBUFS:
case -EAGAIN: case -EAGAIN:
status = xs_nospace(task); status = xs_nospace(task);
break; break;
...@@ -1928,6 +1931,7 @@ static int xs_local_setup_socket(struct sock_xprt *transport) ...@@ -1928,6 +1931,7 @@ static int xs_local_setup_socket(struct sock_xprt *transport)
dprintk("RPC: xprt %p connected to %s\n", dprintk("RPC: xprt %p connected to %s\n",
xprt, xprt->address_strings[RPC_DISPLAY_ADDR]); xprt, xprt->address_strings[RPC_DISPLAY_ADDR]);
xprt_set_connected(xprt); xprt_set_connected(xprt);
case -ENOBUFS:
break; break;
case -ENOENT: case -ENOENT:
dprintk("RPC: xprt %p: socket %s does not exist\n", dprintk("RPC: xprt %p: socket %s does not exist\n",
...@@ -2251,6 +2255,7 @@ static void xs_tcp_setup_socket(struct work_struct *work) ...@@ -2251,6 +2255,7 @@ static void xs_tcp_setup_socket(struct work_struct *work)
case -ECONNREFUSED: case -ECONNREFUSED:
case -ECONNRESET: case -ECONNRESET:
case -ENETUNREACH: case -ENETUNREACH:
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