aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2012-10-15 15:47:41 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2012-11-04 14:43:39 -0500
commit4ea8fed593218b658927b763f02941cd16c2ed9d (patch)
treef7730ffff70dc3dcd7528d6dd197b9e78c7a14ad
parentdeed85e760c8c88cd984c5921dd8cb6b697b6134 (diff)
NFSv4: Get rid of unnecessary BUG_ON()s
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
-rw-r--r--fs/nfs/cache_lib.c1
-rw-r--r--fs/nfs/callback_proc.c1
-rw-r--r--fs/nfs/nfs4file.c1
-rw-r--r--fs/nfs/nfs4proc.c14
-rw-r--r--fs/nfs/nfs4state.c1
5 files changed, 6 insertions, 12 deletions
diff --git a/fs/nfs/cache_lib.c b/fs/nfs/cache_lib.c
index dded26368111..862a2f16db64 100644
--- a/fs/nfs/cache_lib.c
+++ b/fs/nfs/cache_lib.c
@@ -118,7 +118,6 @@ int nfs_cache_register_sb(struct super_block *sb, struct cache_detail *cd)
118 struct dentry *dir; 118 struct dentry *dir;
119 119
120 dir = rpc_d_lookup_sb(sb, "cache"); 120 dir = rpc_d_lookup_sb(sb, "cache");
121 BUG_ON(dir == NULL);
122 ret = sunrpc_cache_register_pipefs(dir, cd->name, 0600, cd); 121 ret = sunrpc_cache_register_pipefs(dir, cd->name, 0600, cd);
123 dput(dir); 122 dput(dir);
124 return ret; 123 return ret;
diff --git a/fs/nfs/callback_proc.c b/fs/nfs/callback_proc.c
index 76b4a7a3e559..0be08b964f38 100644
--- a/fs/nfs/callback_proc.c
+++ b/fs/nfs/callback_proc.c
@@ -216,7 +216,6 @@ static u32 initiate_bulk_draining(struct nfs_client *clp,
216 } 216 }
217 pnfs_get_layout_hdr(lo); 217 pnfs_get_layout_hdr(lo);
218 spin_unlock(&ino->i_lock); 218 spin_unlock(&ino->i_lock);
219 BUG_ON(!list_empty(&lo->plh_bulk_recall));
220 list_add(&lo->plh_bulk_recall, &recall_list); 219 list_add(&lo->plh_bulk_recall, &recall_list);
221 } 220 }
222 } 221 }
diff --git a/fs/nfs/nfs4file.c b/fs/nfs/nfs4file.c
index afddd6639afb..e7699308364a 100644
--- a/fs/nfs/nfs4file.c
+++ b/fs/nfs/nfs4file.c
@@ -20,7 +20,6 @@ nfs4_file_open(struct inode *inode, struct file *filp)
20 struct iattr attr; 20 struct iattr attr;
21 int err; 21 int err;
22 22
23 BUG_ON(inode != dentry->d_inode);
24 /* 23 /*
25 * If no cached dentry exists or if it's negative, NFSv4 handled the 24 * If no cached dentry exists or if it's negative, NFSv4 handled the
26 * opens in ->lookup() or ->create(). 25 * opens in ->lookup() or ->create().
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
415static void 414static void
416nfs4_free_slot(struct nfs4_slot_table *tbl, u32 slotid) 415nfs4_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 3385out_free:
3387 nfs4_free_createdata(data); 3386 nfs4_free_createdata(data);
3388out: 3387out:
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)) {
diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c
index c351e6b39838..e0a28dffd29d 100644
--- a/fs/nfs/nfs4state.c
+++ b/fs/nfs/nfs4state.c
@@ -1086,7 +1086,6 @@ void nfs_free_seqid(struct nfs_seqid *seqid)
1086 */ 1086 */
1087static void nfs_increment_seqid(int status, struct nfs_seqid *seqid) 1087static void nfs_increment_seqid(int status, struct nfs_seqid *seqid)
1088{ 1088{
1089 BUG_ON(list_first_entry(&seqid->sequence->list, struct nfs_seqid, list) != seqid);
1090 switch (status) { 1089 switch (status) {
1091 case 0: 1090 case 0:
1092 break; 1091 break;