summaryrefslogtreecommitdiffstats
path: root/net/sunrpc
diff options
context:
space:
mode:
authorGustavo A. R. Silva <garsilva@embeddedor.com>2017-10-20 12:48:30 -0400
committerAnna Schumaker <Anna.Schumaker@Netapp.com>2017-11-17 16:43:44 -0500
commite9d476393504ff0f9ab38d88d7857ec6a2c81ff6 (patch)
tree537a82d5db221728399ba8edf5d108ebf4487b84 /net/sunrpc
parent6089dd0d731028531fb1148be9fd33274ff90da4 (diff)
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: Gustavo A. R. Silva <garsilva@embeddedor.com> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Diffstat (limited to 'net/sunrpc')
-rw-r--r--net/sunrpc/clnt.c11
-rw-r--r--net/sunrpc/xprt.c1
-rw-r--r--net/sunrpc/xprtsock.c4
3 files changed, 16 insertions, 0 deletions
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c
index 2ad827db2704..d25b077d326d 100644
--- a/net/sunrpc/clnt.c
+++ b/net/sunrpc/clnt.c
@@ -1586,6 +1586,7 @@ call_reserveresult(struct rpc_task *task)
1586 switch (status) { 1586 switch (status) {
1587 case -ENOMEM: 1587 case -ENOMEM:
1588 rpc_delay(task, HZ >> 2); 1588 rpc_delay(task, HZ >> 2);
1589 /* fall through */
1589 case -EAGAIN: /* woken up; retry */ 1590 case -EAGAIN: /* woken up; retry */
1590 task->tk_action = call_retry_reserve; 1591 task->tk_action = call_retry_reserve;
1591 return; 1592 return;
@@ -1647,10 +1648,13 @@ call_refreshresult(struct rpc_task *task)
1647 /* Use rate-limiting and a max number of retries if refresh 1648 /* Use rate-limiting and a max number of retries if refresh
1648 * had status 0 but failed to update the cred. 1649 * had status 0 but failed to update the cred.
1649 */ 1650 */
1651 /* fall through */
1650 case -ETIMEDOUT: 1652 case -ETIMEDOUT:
1651 rpc_delay(task, 3*HZ); 1653 rpc_delay(task, 3*HZ);
1654 /* fall through */
1652 case -EAGAIN: 1655 case -EAGAIN:
1653 status = -EACCES; 1656 status = -EACCES;
1657 /* fall through */
1654 case -EKEYEXPIRED: 1658 case -EKEYEXPIRED:
1655 if (!task->tk_cred_retry) 1659 if (!task->tk_cred_retry)
1656 break; 1660 break;
@@ -1911,6 +1915,7 @@ call_connect_status(struct rpc_task *task)
1911 task->tk_action = call_bind; 1915 task->tk_action = call_bind;
1912 return; 1916 return;
1913 } 1917 }
1918 /* fall through */
1914 case -ECONNRESET: 1919 case -ECONNRESET:
1915 case -ECONNABORTED: 1920 case -ECONNABORTED:
1916 case -ENETUNREACH: 1921 case -ENETUNREACH:
@@ -1924,6 +1929,7 @@ call_connect_status(struct rpc_task *task)
1924 break; 1929 break;
1925 /* retry with existing socket, after a delay */ 1930 /* retry with existing socket, after a delay */
1926 rpc_delay(task, 3*HZ); 1931 rpc_delay(task, 3*HZ);
1932 /* fall through */
1927 case -EAGAIN: 1933 case -EAGAIN:
1928 /* Check for timeouts before looping back to call_bind */ 1934 /* Check for timeouts before looping back to call_bind */
1929 case -ETIMEDOUT: 1935 case -ETIMEDOUT:
@@ -2025,6 +2031,7 @@ call_transmit_status(struct rpc_task *task)
2025 rpc_exit(task, task->tk_status); 2031 rpc_exit(task, task->tk_status);
2026 break; 2032 break;
2027 } 2033 }
2034 /* fall through */
2028 case -ECONNRESET: 2035 case -ECONNRESET:
2029 case -ECONNABORTED: 2036 case -ECONNABORTED:
2030 case -EADDRINUSE: 2037 case -EADDRINUSE:
@@ -2145,6 +2152,7 @@ call_status(struct rpc_task *task)
2145 * were a timeout. 2152 * were a timeout.
2146 */ 2153 */
2147 rpc_delay(task, 3*HZ); 2154 rpc_delay(task, 3*HZ);
2155 /* fall through */
2148 case -ETIMEDOUT: 2156 case -ETIMEDOUT:
2149 task->tk_action = call_timeout; 2157 task->tk_action = call_timeout;
2150 break; 2158 break;
@@ -2152,14 +2160,17 @@ call_status(struct rpc_task *task)
2152 case -ECONNRESET: 2160 case -ECONNRESET:
2153 case -ECONNABORTED: 2161 case -ECONNABORTED:
2154 rpc_force_rebind(clnt); 2162 rpc_force_rebind(clnt);
2163 /* fall through */
2155 case -EADDRINUSE: 2164 case -EADDRINUSE:
2156 rpc_delay(task, 3*HZ); 2165 rpc_delay(task, 3*HZ);
2166 /* fall through */
2157 case -EPIPE: 2167 case -EPIPE:
2158 case -ENOTCONN: 2168 case -ENOTCONN:
2159 task->tk_action = call_bind; 2169 task->tk_action = call_bind;
2160 break; 2170 break;
2161 case -ENOBUFS: 2171 case -ENOBUFS:
2162 rpc_delay(task, HZ>>2); 2172 rpc_delay(task, HZ>>2);
2173 /* fall through */
2163 case -EAGAIN: 2174 case -EAGAIN:
2164 task->tk_action = call_transmit; 2175 task->tk_action = call_transmit;
2165 break; 2176 break;
diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c
index e741ec2b4d8e..02a9bacb239b 100644
--- a/net/sunrpc/xprt.c
+++ b/net/sunrpc/xprt.c
@@ -1139,6 +1139,7 @@ void xprt_alloc_slot(struct rpc_xprt *xprt, struct rpc_task *task)
1139 case -EAGAIN: 1139 case -EAGAIN:
1140 xprt_add_backlog(xprt, task); 1140 xprt_add_backlog(xprt, task);
1141 dprintk("RPC: waiting for request slot\n"); 1141 dprintk("RPC: waiting for request slot\n");
1142 /* fall through */
1142 default: 1143 default:
1143 task->tk_status = -EAGAIN; 1144 task->tk_status = -EAGAIN;
1144 } 1145 }
diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
index c1841f234a71..684e356b40e4 100644
--- a/net/sunrpc/xprtsock.c
+++ b/net/sunrpc/xprtsock.c
@@ -551,6 +551,7 @@ static int xs_local_send_request(struct rpc_task *task)
551 default: 551 default:
552 dprintk("RPC: sendmsg returned unrecognized error %d\n", 552 dprintk("RPC: sendmsg returned unrecognized error %d\n",
553 -status); 553 -status);
554 /* fall through */
554 case -EPIPE: 555 case -EPIPE:
555 xs_close(xprt); 556 xs_close(xprt);
556 status = -ENOTCONN; 557 status = -ENOTCONN;
@@ -1610,6 +1611,7 @@ static void xs_tcp_state_change(struct sock *sk)
1610 xprt->connect_cookie++; 1611 xprt->connect_cookie++;
1611 clear_bit(XPRT_CONNECTED, &xprt->state); 1612 clear_bit(XPRT_CONNECTED, &xprt->state);
1612 xs_tcp_force_close(xprt); 1613 xs_tcp_force_close(xprt);
1614 /* fall through */
1613 case TCP_CLOSING: 1615 case TCP_CLOSING:
1614 /* 1616 /*
1615 * If the server closed down the connection, make sure that 1617 * 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 switch (ret) { 2369 switch (ret) {
2368 case 0: 2370 case 0:
2369 xs_set_srcport(transport, sock); 2371 xs_set_srcport(transport, sock);
2372 /* fall through */
2370 case -EINPROGRESS: 2373 case -EINPROGRESS:
2371 /* SYN_SENT! */ 2374 /* SYN_SENT! */
2372 if (xprt->reestablish_timeout < XS_TCP_INIT_REEST_TO) 2375 if (xprt->reestablish_timeout < XS_TCP_INIT_REEST_TO)
@@ -2418,6 +2421,7 @@ static void xs_tcp_setup_socket(struct work_struct *work)
2418 default: 2421 default:
2419 printk("%s: connect returned unhandled error %d\n", 2422 printk("%s: connect returned unhandled error %d\n",
2420 __func__, status); 2423 __func__, status);
2424 /* fall through */
2421 case -EADDRNOTAVAIL: 2425 case -EADDRNOTAVAIL:
2422 /* We're probably in TIME_WAIT. Get rid of existing socket, 2426 /* We're probably in TIME_WAIT. Get rid of existing socket,
2423 * and retry 2427 * and retry