diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-10-15 15:47:41 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-11-04 14:43:39 -0500 |
commit | 4ea8fed593218b658927b763f02941cd16c2ed9d (patch) | |
tree | f7730ffff70dc3dcd7528d6dd197b9e78c7a14ad /fs/nfs/nfs4proc.c | |
parent | deed85e760c8c88cd984c5921dd8cb6b697b6134 (diff) |
NFSv4: Get rid of unnecessary BUG_ON()s
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/nfs4proc.c')
-rw-r--r-- | fs/nfs/nfs4proc.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 14d86ef493a0..6300cdd81101 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c | |||
@@ -206,7 +206,6 @@ static void nfs4_setup_readdir(u64 cookie, __be32 *verifier, struct dentry *dent | |||
206 | { | 206 | { |
207 | __be32 *start, *p; | 207 | __be32 *start, *p; |
208 | 208 | ||
209 | BUG_ON(readdir->count < 80); | ||
210 | if (cookie > 2) { | 209 | if (cookie > 2) { |
211 | readdir->cookie = cookie; | 210 | readdir->cookie = cookie; |
212 | memcpy(&readdir->verifier, verifier, sizeof(readdir->verifier)); | 211 | memcpy(&readdir->verifier, verifier, sizeof(readdir->verifier)); |
@@ -415,7 +414,6 @@ static void renew_lease(const struct nfs_server *server, unsigned long timestamp | |||
415 | static void | 414 | static void |
416 | nfs4_free_slot(struct nfs4_slot_table *tbl, u32 slotid) | 415 | nfs4_free_slot(struct nfs4_slot_table *tbl, u32 slotid) |
417 | { | 416 | { |
418 | BUG_ON(slotid >= NFS4_MAX_SLOT_TABLE); | ||
419 | /* clear used bit in bitmap */ | 417 | /* clear used bit in bitmap */ |
420 | __clear_bit(slotid, tbl->used_slots); | 418 | __clear_bit(slotid, tbl->used_slots); |
421 | 419 | ||
@@ -2533,7 +2531,8 @@ static int nfs4_find_root_sec(struct nfs_server *server, struct nfs_fh *fhandle, | |||
2533 | rpc_authflavor_t flav_array[NFS_MAX_SECFLAVORS]; | 2531 | rpc_authflavor_t flav_array[NFS_MAX_SECFLAVORS]; |
2534 | 2532 | ||
2535 | len = rpcauth_list_flavors(flav_array, ARRAY_SIZE(flav_array)); | 2533 | len = rpcauth_list_flavors(flav_array, ARRAY_SIZE(flav_array)); |
2536 | BUG_ON(len < 0); | 2534 | if (len < 0) |
2535 | return len; | ||
2537 | 2536 | ||
2538 | for (i = 0; i < len; i++) { | 2537 | for (i = 0; i < len; i++) { |
2539 | /* AUTH_UNIX is the default flavor if none was specified, | 2538 | /* AUTH_UNIX is the default flavor if none was specified, |
@@ -3362,9 +3361,6 @@ static int _nfs4_proc_mknod(struct inode *dir, struct dentry *dentry, | |||
3362 | int mode = sattr->ia_mode; | 3361 | int mode = sattr->ia_mode; |
3363 | int status = -ENOMEM; | 3362 | int status = -ENOMEM; |
3364 | 3363 | ||
3365 | BUG_ON(!(sattr->ia_valid & ATTR_MODE)); | ||
3366 | BUG_ON(!S_ISFIFO(mode) && !S_ISBLK(mode) && !S_ISCHR(mode) && !S_ISSOCK(mode)); | ||
3367 | |||
3368 | data = nfs4_alloc_createdata(dir, &dentry->d_name, sattr, NF4SOCK); | 3364 | data = nfs4_alloc_createdata(dir, &dentry->d_name, sattr, NF4SOCK); |
3369 | if (data == NULL) | 3365 | if (data == NULL) |
3370 | goto out; | 3366 | goto out; |
@@ -3380,10 +3376,13 @@ static int _nfs4_proc_mknod(struct inode *dir, struct dentry *dentry, | |||
3380 | data->arg.ftype = NF4CHR; | 3376 | data->arg.ftype = NF4CHR; |
3381 | data->arg.u.device.specdata1 = MAJOR(rdev); | 3377 | data->arg.u.device.specdata1 = MAJOR(rdev); |
3382 | data->arg.u.device.specdata2 = MINOR(rdev); | 3378 | data->arg.u.device.specdata2 = MINOR(rdev); |
3379 | } else if (!S_ISSOCK(mode)) { | ||
3380 | status = -EINVAL; | ||
3381 | goto out_free; | ||
3383 | } | 3382 | } |
3384 | 3383 | ||
3385 | status = nfs4_do_create(dir, dentry, data); | 3384 | status = nfs4_do_create(dir, dentry, data); |
3386 | 3385 | out_free: | |
3387 | nfs4_free_createdata(data); | 3386 | nfs4_free_createdata(data); |
3388 | out: | 3387 | out: |
3389 | return status; | 3388 | return status; |
@@ -5357,7 +5356,6 @@ int nfs4_proc_bind_conn_to_session(struct nfs_client *clp, struct rpc_cred *cred | |||
5357 | }; | 5356 | }; |
5358 | 5357 | ||
5359 | dprintk("--> %s\n", __func__); | 5358 | dprintk("--> %s\n", __func__); |
5360 | BUG_ON(clp == NULL); | ||
5361 | 5359 | ||
5362 | res.session = kzalloc(sizeof(struct nfs4_session), GFP_NOFS); | 5360 | res.session = kzalloc(sizeof(struct nfs4_session), GFP_NOFS); |
5363 | if (unlikely(res.session == NULL)) { | 5361 | if (unlikely(res.session == NULL)) { |