Commit e9d47639 authored by Gustavo A. R. Silva's avatar Gustavo A. R. Silva Committed by Anna Schumaker

net: sunrpc: mark expected switch fall-throughs

In preparation to enabling -Wimplicit-fallthrough, mark switch cases
where we are expecting to fall through.
Signed-off-by: default avatarGustavo A. R. Silva <garsilva@embeddedor.com>
Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
parent 6089dd0d
...@@ -1586,6 +1586,7 @@ call_reserveresult(struct rpc_task *task) ...@@ -1586,6 +1586,7 @@ call_reserveresult(struct rpc_task *task)
switch (status) { switch (status) {
case -ENOMEM: case -ENOMEM:
rpc_delay(task, HZ >> 2); rpc_delay(task, HZ >> 2);
/* fall through */
case -EAGAIN: /* woken up; retry */ case -EAGAIN: /* woken up; retry */
task->tk_action = call_retry_reserve; task->tk_action = call_retry_reserve;
return; return;
...@@ -1647,10 +1648,13 @@ call_refreshresult(struct rpc_task *task) ...@@ -1647,10 +1648,13 @@ call_refreshresult(struct rpc_task *task)
/* Use rate-limiting and a max number of retries if refresh /* Use rate-limiting and a max number of retries if refresh
* had status 0 but failed to update the cred. * had status 0 but failed to update the cred.
*/ */
/* fall through */
case -ETIMEDOUT: case -ETIMEDOUT:
rpc_delay(task, 3*HZ); rpc_delay(task, 3*HZ);
/* fall through */
case -EAGAIN: case -EAGAIN:
status = -EACCES; status = -EACCES;
/* fall through */
case -EKEYEXPIRED: case -EKEYEXPIRED:
if (!task->tk_cred_retry) if (!task->tk_cred_retry)
break; break;
...@@ -1911,6 +1915,7 @@ call_connect_status(struct rpc_task *task) ...@@ -1911,6 +1915,7 @@ call_connect_status(struct rpc_task *task)
task->tk_action = call_bind; task->tk_action = call_bind;
return; return;
} }
/* fall through */
case -ECONNRESET: case -ECONNRESET:
case -ECONNABORTED: case -ECONNABORTED:
case -ENETUNREACH: case -ENETUNREACH:
...@@ -1924,6 +1929,7 @@ call_connect_status(struct rpc_task *task) ...@@ -1924,6 +1929,7 @@ call_connect_status(struct rpc_task *task)
break; break;
/* retry with existing socket, after a delay */ /* retry with existing socket, after a delay */
rpc_delay(task, 3*HZ); rpc_delay(task, 3*HZ);
/* fall through */
case -EAGAIN: case -EAGAIN:
/* Check for timeouts before looping back to call_bind */ /* Check for timeouts before looping back to call_bind */
case -ETIMEDOUT: case -ETIMEDOUT:
...@@ -2025,6 +2031,7 @@ call_transmit_status(struct rpc_task *task) ...@@ -2025,6 +2031,7 @@ call_transmit_status(struct rpc_task *task)
rpc_exit(task, task->tk_status); rpc_exit(task, task->tk_status);
break; break;
} }
/* fall through */
case -ECONNRESET: case -ECONNRESET:
case -ECONNABORTED: case -ECONNABORTED:
case -EADDRINUSE: case -EADDRINUSE:
...@@ -2145,6 +2152,7 @@ call_status(struct rpc_task *task) ...@@ -2145,6 +2152,7 @@ call_status(struct rpc_task *task)
* were a timeout. * were a timeout.
*/ */
rpc_delay(task, 3*HZ); rpc_delay(task, 3*HZ);
/* fall through */
case -ETIMEDOUT: case -ETIMEDOUT:
task->tk_action = call_timeout; task->tk_action = call_timeout;
break; break;
...@@ -2152,14 +2160,17 @@ call_status(struct rpc_task *task) ...@@ -2152,14 +2160,17 @@ call_status(struct rpc_task *task)
case -ECONNRESET: case -ECONNRESET:
case -ECONNABORTED: case -ECONNABORTED:
rpc_force_rebind(clnt); rpc_force_rebind(clnt);
/* fall through */
case -EADDRINUSE: case -EADDRINUSE:
rpc_delay(task, 3*HZ); rpc_delay(task, 3*HZ);
/* fall through */
case -EPIPE: case -EPIPE:
case -ENOTCONN: case -ENOTCONN:
task->tk_action = call_bind; task->tk_action = call_bind;
break; break;
case -ENOBUFS: case -ENOBUFS:
rpc_delay(task, HZ>>2); rpc_delay(task, HZ>>2);
/* fall through */
case -EAGAIN: case -EAGAIN:
task->tk_action = call_transmit; task->tk_action = call_transmit;
break; break;
......
...@@ -1139,6 +1139,7 @@ void xprt_alloc_slot(struct rpc_xprt *xprt, struct rpc_task *task) ...@@ -1139,6 +1139,7 @@ void xprt_alloc_slot(struct rpc_xprt *xprt, struct rpc_task *task)
case -EAGAIN: case -EAGAIN:
xprt_add_backlog(xprt, task); xprt_add_backlog(xprt, task);
dprintk("RPC: waiting for request slot\n"); dprintk("RPC: waiting for request slot\n");
/* fall through */
default: default:
task->tk_status = -EAGAIN; task->tk_status = -EAGAIN;
} }
......
...@@ -551,6 +551,7 @@ static int xs_local_send_request(struct rpc_task *task) ...@@ -551,6 +551,7 @@ static int xs_local_send_request(struct rpc_task *task)
default: default:
dprintk("RPC: sendmsg returned unrecognized error %d\n", dprintk("RPC: sendmsg returned unrecognized error %d\n",
-status); -status);
/* fall through */
case -EPIPE: case -EPIPE:
xs_close(xprt); xs_close(xprt);
status = -ENOTCONN; status = -ENOTCONN;
...@@ -1610,6 +1611,7 @@ static void xs_tcp_state_change(struct sock *sk) ...@@ -1610,6 +1611,7 @@ static void xs_tcp_state_change(struct sock *sk)
xprt->connect_cookie++; xprt->connect_cookie++;
clear_bit(XPRT_CONNECTED, &xprt->state); clear_bit(XPRT_CONNECTED, &xprt->state);
xs_tcp_force_close(xprt); xs_tcp_force_close(xprt);
/* fall through */
case TCP_CLOSING: case TCP_CLOSING:
/* /*
* If the server closed down the connection, make sure that * If the server closed down the connection, make sure that
...@@ -2367,6 +2369,7 @@ static int xs_tcp_finish_connecting(struct rpc_xprt *xprt, struct socket *sock) ...@@ -2367,6 +2369,7 @@ static int xs_tcp_finish_connecting(struct rpc_xprt *xprt, struct socket *sock)
switch (ret) { switch (ret) {
case 0: case 0:
xs_set_srcport(transport, sock); xs_set_srcport(transport, sock);
/* fall through */
case -EINPROGRESS: case -EINPROGRESS:
/* SYN_SENT! */ /* SYN_SENT! */
if (xprt->reestablish_timeout < XS_TCP_INIT_REEST_TO) if (xprt->reestablish_timeout < XS_TCP_INIT_REEST_TO)
...@@ -2418,6 +2421,7 @@ static void xs_tcp_setup_socket(struct work_struct *work) ...@@ -2418,6 +2421,7 @@ static void xs_tcp_setup_socket(struct work_struct *work)
default: default:
printk("%s: connect returned unhandled error %d\n", printk("%s: connect returned unhandled error %d\n",
__func__, status); __func__, status);
/* fall through */
case -EADDRNOTAVAIL: case -EADDRNOTAVAIL:
/* We're probably in TIME_WAIT. Get rid of existing socket, /* We're probably in TIME_WAIT. Get rid of existing socket,
* and retry * and retry
......
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