1
0
Fork 0

NFS: Mark expected switch fall-throughs

In preparation to enabling -Wimplicit-fallthrough, mark switch cases
where we are expecting to fall through.

Warning level 2 was used: -Wimplicit-fallthrough=2

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
hifive-unleashed-5.1
Gustavo A. R. Silva 2018-07-31 21:18:44 -05:00 committed by Anna Schumaker
parent c8d07159c9
commit 01e03bdc74
7 changed files with 21 additions and 0 deletions

View File

@ -753,6 +753,7 @@ out:
case -ENODEV: case -ENODEV:
/* Our extent block devices are unavailable */ /* Our extent block devices are unavailable */
set_bit(NFS_LSEG_UNAVAILABLE, &lseg->pls_flags); set_bit(NFS_LSEG_UNAVAILABLE, &lseg->pls_flags);
/* Fall through */
case 0: case 0:
return lseg; return lseg;
default: default:

View File

@ -108,6 +108,7 @@ struct posix_acl *nfs3_get_acl(struct inode *inode, int type)
case -EPROTONOSUPPORT: case -EPROTONOSUPPORT:
dprintk("NFS_V3_ACL extension not supported; disabling\n"); dprintk("NFS_V3_ACL extension not supported; disabling\n");
server->caps &= ~NFS_CAP_ACLS; server->caps &= ~NFS_CAP_ACLS;
/* fall through */
case -ENOTSUPP: case -ENOTSUPP:
status = -EOPNOTSUPP; status = -EOPNOTSUPP;
default: default:
@ -229,6 +230,7 @@ static int __nfs3_proc_setacls(struct inode *inode, struct posix_acl *acl,
dprintk("NFS_V3_ACL SETACL RPC not supported" dprintk("NFS_V3_ACL SETACL RPC not supported"
"(will not retry)\n"); "(will not retry)\n");
server->caps &= ~NFS_CAP_ACLS; server->caps &= ~NFS_CAP_ACLS;
/* fall through */
case -ENOTSUPP: case -ENOTSUPP:
status = -EOPNOTSUPP; status = -EOPNOTSUPP;
} }

View File

@ -149,6 +149,7 @@ static loff_t nfs4_file_llseek(struct file *filep, loff_t offset, int whence)
ret = nfs42_proc_llseek(filep, offset, whence); ret = nfs42_proc_llseek(filep, offset, whence);
if (ret != -ENOTSUPP) if (ret != -ENOTSUPP)
return ret; return ret;
/* Fall through */
default: default:
return nfs_file_llseek(filep, offset, whence); return nfs_file_llseek(filep, offset, whence);
} }

View File

@ -506,6 +506,7 @@ static int nfs_idmap_prepare_message(char *desc, struct idmap *idmap,
switch (token) { switch (token) {
case Opt_find_uid: case Opt_find_uid:
im->im_type = IDMAP_TYPE_USER; im->im_type = IDMAP_TYPE_USER;
/* Fall through */
case Opt_find_gid: case Opt_find_gid:
im->im_conv = IDMAP_CONV_NAMETOID; im->im_conv = IDMAP_CONV_NAMETOID;
ret = match_strlcpy(im->im_name, &substr, IDMAP_NAMESZ); ret = match_strlcpy(im->im_name, &substr, IDMAP_NAMESZ);
@ -513,6 +514,7 @@ static int nfs_idmap_prepare_message(char *desc, struct idmap *idmap,
case Opt_find_user: case Opt_find_user:
im->im_type = IDMAP_TYPE_USER; im->im_type = IDMAP_TYPE_USER;
/* Fall through */
case Opt_find_group: case Opt_find_group:
im->im_conv = IDMAP_CONV_IDTONAME; im->im_conv = IDMAP_CONV_IDTONAME;
ret = match_int(&substr, &im->im_id); ret = match_int(&substr, &im->im_id);

View File

@ -449,6 +449,7 @@ static int nfs4_do_handle_exception(struct nfs_server *server,
stateid); stateid);
goto wait_on_recovery; goto wait_on_recovery;
} }
/* Fall through */
case -NFS4ERR_OPENMODE: case -NFS4ERR_OPENMODE:
if (inode) { if (inode) {
int err; int err;
@ -501,8 +502,10 @@ static int nfs4_do_handle_exception(struct nfs_server *server,
ret = -EBUSY; ret = -EBUSY;
break; break;
} }
/* Fall through */
case -NFS4ERR_DELAY: case -NFS4ERR_DELAY:
nfs_inc_server_stats(server, NFSIOS_DELAY); nfs_inc_server_stats(server, NFSIOS_DELAY);
/* Fall through */
case -NFS4ERR_GRACE: case -NFS4ERR_GRACE:
case -NFS4ERR_LAYOUTTRYLATER: case -NFS4ERR_LAYOUTTRYLATER:
case -NFS4ERR_RECALLCONFLICT: case -NFS4ERR_RECALLCONFLICT:
@ -1385,6 +1388,7 @@ static int can_open_delegated(struct nfs_delegation *delegation, fmode_t fmode,
case NFS4_OPEN_CLAIM_PREVIOUS: case NFS4_OPEN_CLAIM_PREVIOUS:
if (!test_bit(NFS_DELEGATION_NEED_RECLAIM, &delegation->flags)) if (!test_bit(NFS_DELEGATION_NEED_RECLAIM, &delegation->flags))
break; break;
/* Fall through */
default: default:
return 0; return 0;
} }
@ -2154,6 +2158,7 @@ int nfs4_open_delegation_recall(struct nfs_open_context *ctx,
err = nfs4_open_recover_helper(opendata, FMODE_WRITE); err = nfs4_open_recover_helper(opendata, FMODE_WRITE);
if (err) if (err)
break; break;
/* Fall through */
case FMODE_READ: case FMODE_READ:
err = nfs4_open_recover_helper(opendata, FMODE_READ); err = nfs4_open_recover_helper(opendata, FMODE_READ);
} }
@ -2283,6 +2288,7 @@ static void nfs4_open_prepare(struct rpc_task *task, void *calldata)
case NFS4_OPEN_CLAIM_DELEG_CUR_FH: case NFS4_OPEN_CLAIM_DELEG_CUR_FH:
case NFS4_OPEN_CLAIM_DELEG_PREV_FH: case NFS4_OPEN_CLAIM_DELEG_PREV_FH:
data->o_arg.open_bitmap = &nfs4_open_noattr_bitmap[0]; data->o_arg.open_bitmap = &nfs4_open_noattr_bitmap[0];
/* Fall through */
case NFS4_OPEN_CLAIM_FH: case NFS4_OPEN_CLAIM_FH:
task->tk_msg.rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_OPEN_NOATTR]; task->tk_msg.rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_OPEN_NOATTR];
} }
@ -6267,11 +6273,13 @@ static void nfs4_locku_done(struct rpc_task *task, void *data)
if (nfs4_update_lock_stateid(calldata->lsp, if (nfs4_update_lock_stateid(calldata->lsp,
&calldata->res.stateid)) &calldata->res.stateid))
break; break;
/* Fall through */
case -NFS4ERR_ADMIN_REVOKED: case -NFS4ERR_ADMIN_REVOKED:
case -NFS4ERR_EXPIRED: case -NFS4ERR_EXPIRED:
nfs4_free_revoked_stateid(calldata->server, nfs4_free_revoked_stateid(calldata->server,
&calldata->arg.stateid, &calldata->arg.stateid,
task->tk_msg.rpc_cred); task->tk_msg.rpc_cred);
/* Fall through */
case -NFS4ERR_BAD_STATEID: case -NFS4ERR_BAD_STATEID:
case -NFS4ERR_OLD_STATEID: case -NFS4ERR_OLD_STATEID:
case -NFS4ERR_STALE_STATEID: case -NFS4ERR_STALE_STATEID:

View File

@ -1525,6 +1525,7 @@ restart:
default: default:
pr_err("NFS: %s: unhandled error %d\n", pr_err("NFS: %s: unhandled error %d\n",
__func__, status); __func__, status);
/* Fall through */
case -ENOMEM: case -ENOMEM:
case -NFS4ERR_DENIED: case -NFS4ERR_DENIED:
case -NFS4ERR_RECLAIM_BAD: case -NFS4ERR_RECLAIM_BAD:
@ -1597,6 +1598,7 @@ restart:
default: default:
printk(KERN_ERR "NFS: %s: unhandled error %d\n", printk(KERN_ERR "NFS: %s: unhandled error %d\n",
__func__, status); __func__, status);
/* Fall through */
case -ENOENT: case -ENOENT:
case -ENOMEM: case -ENOMEM:
case -EACCES: case -EACCES:
@ -1608,6 +1610,7 @@ restart:
break; break;
case -EAGAIN: case -EAGAIN:
ssleep(1); ssleep(1);
/* Fall through */
case -NFS4ERR_ADMIN_REVOKED: case -NFS4ERR_ADMIN_REVOKED:
case -NFS4ERR_STALE_STATEID: case -NFS4ERR_STALE_STATEID:
case -NFS4ERR_OLD_STATEID: case -NFS4ERR_OLD_STATEID:
@ -2190,9 +2193,11 @@ again:
case -ETIMEDOUT: case -ETIMEDOUT:
if (clnt->cl_softrtry) if (clnt->cl_softrtry)
break; break;
/* Fall through */
case -NFS4ERR_DELAY: case -NFS4ERR_DELAY:
case -EAGAIN: case -EAGAIN:
ssleep(1); ssleep(1);
/* Fall through */
case -NFS4ERR_STALE_CLIENTID: case -NFS4ERR_STALE_CLIENTID:
dprintk("NFS: %s after status %d, retrying\n", dprintk("NFS: %s after status %d, retrying\n",
__func__, status); __func__, status);
@ -2204,6 +2209,7 @@ again:
} }
if (clnt->cl_auth->au_flavor == RPC_AUTH_UNIX) if (clnt->cl_auth->au_flavor == RPC_AUTH_UNIX)
break; break;
/* Fall through */
case -NFS4ERR_CLID_INUSE: case -NFS4ERR_CLID_INUSE:
case -NFS4ERR_WRONGSEC: case -NFS4ERR_WRONGSEC:
/* No point in retrying if we already used RPC_AUTH_UNIX */ /* No point in retrying if we already used RPC_AUTH_UNIX */

View File

@ -561,6 +561,7 @@ static void nfs_pgio_rpcsetup(struct nfs_pgio_header *hdr,
case FLUSH_COND_STABLE: case FLUSH_COND_STABLE:
if (nfs_reqs_to_commit(cinfo)) if (nfs_reqs_to_commit(cinfo))
break; break;
/* fall through */
default: default:
hdr->args.stable = NFS_FILE_SYNC; hdr->args.stable = NFS_FILE_SYNC;
} }