diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-10-15 14:58:04 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-11-04 14:43:39 -0500 |
commit | bc5a89b337ee4b2fa6f577e7e1220d8c1ece71fc (patch) | |
tree | 6880127e805e1739dd00b2f8b5e65dbcff699567 | |
parent | eba24e1fe57df4e4cdee58af940f762eb336a113 (diff) |
NFSv4.1: Remove assertion BUG_ON()s from the files and generic layout code
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
-rw-r--r-- | fs/nfs/nfs4filelayout.c | 13 | ||||
-rw-r--r-- | fs/nfs/nfs4filelayoutdev.c | 2 | ||||
-rw-r--r-- | fs/nfs/pnfs.c | 6 |
3 files changed, 6 insertions, 15 deletions
diff --git a/fs/nfs/nfs4filelayout.c b/fs/nfs/nfs4filelayout.c index 2e45fd9c02a3..bfb28fa38e74 100644 --- a/fs/nfs/nfs4filelayout.c +++ b/fs/nfs/nfs4filelayout.c | |||
@@ -512,7 +512,6 @@ filelayout_read_pagelist(struct nfs_read_data *data) | |||
512 | loff_t offset = data->args.offset; | 512 | loff_t offset = data->args.offset; |
513 | u32 j, idx; | 513 | u32 j, idx; |
514 | struct nfs_fh *fh; | 514 | struct nfs_fh *fh; |
515 | int status; | ||
516 | 515 | ||
517 | dprintk("--> %s ino %lu pgbase %u req %Zu@%llu\n", | 516 | dprintk("--> %s ino %lu pgbase %u req %Zu@%llu\n", |
518 | __func__, hdr->inode->i_ino, | 517 | __func__, hdr->inode->i_ino, |
@@ -538,9 +537,8 @@ filelayout_read_pagelist(struct nfs_read_data *data) | |||
538 | data->mds_offset = offset; | 537 | data->mds_offset = offset; |
539 | 538 | ||
540 | /* Perform an asynchronous read to ds */ | 539 | /* Perform an asynchronous read to ds */ |
541 | status = nfs_initiate_read(ds->ds_clp->cl_rpcclient, data, | 540 | nfs_initiate_read(ds->ds_clp->cl_rpcclient, data, |
542 | &filelayout_read_call_ops, RPC_TASK_SOFTCONN); | 541 | &filelayout_read_call_ops, RPC_TASK_SOFTCONN); |
543 | BUG_ON(status != 0); | ||
544 | return PNFS_ATTEMPTED; | 542 | return PNFS_ATTEMPTED; |
545 | } | 543 | } |
546 | 544 | ||
@@ -554,7 +552,6 @@ filelayout_write_pagelist(struct nfs_write_data *data, int sync) | |||
554 | loff_t offset = data->args.offset; | 552 | loff_t offset = data->args.offset; |
555 | u32 j, idx; | 553 | u32 j, idx; |
556 | struct nfs_fh *fh; | 554 | struct nfs_fh *fh; |
557 | int status; | ||
558 | 555 | ||
559 | /* Retrieve the correct rpc_client for the byte range */ | 556 | /* Retrieve the correct rpc_client for the byte range */ |
560 | j = nfs4_fl_calc_j_index(lseg, offset); | 557 | j = nfs4_fl_calc_j_index(lseg, offset); |
@@ -579,10 +576,9 @@ filelayout_write_pagelist(struct nfs_write_data *data, int sync) | |||
579 | data->args.offset = filelayout_get_dserver_offset(lseg, offset); | 576 | data->args.offset = filelayout_get_dserver_offset(lseg, offset); |
580 | 577 | ||
581 | /* Perform an asynchronous write */ | 578 | /* Perform an asynchronous write */ |
582 | status = nfs_initiate_write(ds->ds_clp->cl_rpcclient, data, | 579 | nfs_initiate_write(ds->ds_clp->cl_rpcclient, data, |
583 | &filelayout_write_call_ops, sync, | 580 | &filelayout_write_call_ops, sync, |
584 | RPC_TASK_SOFTCONN); | 581 | RPC_TASK_SOFTCONN); |
585 | BUG_ON(status != 0); | ||
586 | return PNFS_ATTEMPTED; | 582 | return PNFS_ATTEMPTED; |
587 | } | 583 | } |
588 | 584 | ||
@@ -909,7 +905,7 @@ static void | |||
909 | filelayout_pg_init_read(struct nfs_pageio_descriptor *pgio, | 905 | filelayout_pg_init_read(struct nfs_pageio_descriptor *pgio, |
910 | struct nfs_page *req) | 906 | struct nfs_page *req) |
911 | { | 907 | { |
912 | BUG_ON(pgio->pg_lseg != NULL); | 908 | WARN_ON_ONCE(pgio->pg_lseg != NULL); |
913 | 909 | ||
914 | if (req->wb_offset != req->wb_pgbase) { | 910 | if (req->wb_offset != req->wb_pgbase) { |
915 | /* | 911 | /* |
@@ -939,7 +935,7 @@ filelayout_pg_init_write(struct nfs_pageio_descriptor *pgio, | |||
939 | struct nfs_commit_info cinfo; | 935 | struct nfs_commit_info cinfo; |
940 | int status; | 936 | int status; |
941 | 937 | ||
942 | BUG_ON(pgio->pg_lseg != NULL); | 938 | WARN_ON_ONCE(pgio->pg_lseg != NULL); |
943 | 939 | ||
944 | if (req->wb_offset != req->wb_pgbase) | 940 | if (req->wb_offset != req->wb_pgbase) |
945 | goto out_mds; | 941 | goto out_mds; |
@@ -1187,7 +1183,6 @@ static void filelayout_recover_commit_reqs(struct list_head *dst, | |||
1187 | */ | 1183 | */ |
1188 | for (i = 0, b = cinfo->ds->buckets; i < cinfo->ds->nbuckets; i++, b++) { | 1184 | for (i = 0, b = cinfo->ds->buckets; i < cinfo->ds->nbuckets; i++, b++) { |
1189 | if (transfer_commit_list(&b->written, dst, cinfo, 0)) { | 1185 | if (transfer_commit_list(&b->written, dst, cinfo, 0)) { |
1190 | BUG_ON(!list_empty(&b->written)); | ||
1191 | pnfs_put_lseg(b->wlseg); | 1186 | pnfs_put_lseg(b->wlseg); |
1192 | b->wlseg = NULL; | 1187 | b->wlseg = NULL; |
1193 | } | 1188 | } |
diff --git a/fs/nfs/nfs4filelayoutdev.c b/fs/nfs/nfs4filelayoutdev.c index a8eaa9b7bb0f..93e2530d7098 100644 --- a/fs/nfs/nfs4filelayoutdev.c +++ b/fs/nfs/nfs4filelayoutdev.c | |||
@@ -162,8 +162,6 @@ nfs4_ds_connect(struct nfs_server *mds_srv, struct nfs4_pnfs_ds *ds) | |||
162 | dprintk("--> %s DS %s au_flavor %d\n", __func__, ds->ds_remotestr, | 162 | dprintk("--> %s DS %s au_flavor %d\n", __func__, ds->ds_remotestr, |
163 | mds_srv->nfs_client->cl_rpcclient->cl_auth->au_flavor); | 163 | mds_srv->nfs_client->cl_rpcclient->cl_auth->au_flavor); |
164 | 164 | ||
165 | BUG_ON(list_empty(&ds->ds_addrs)); | ||
166 | |||
167 | list_for_each_entry(da, &ds->ds_addrs, da_node) { | 165 | list_for_each_entry(da, &ds->ds_addrs, da_node) { |
168 | dprintk("%s: DS %s: trying address %s\n", | 166 | dprintk("%s: DS %s: trying address %s\n", |
169 | __func__, ds->ds_remotestr, da->da_remotestr); | 167 | __func__, ds->ds_remotestr, da->da_remotestr); |
diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c index dcbc9b20474b..e7165d915362 100644 --- a/fs/nfs/pnfs.c +++ b/fs/nfs/pnfs.c | |||
@@ -634,7 +634,6 @@ send_layoutget(struct pnfs_layout_hdr *lo, | |||
634 | 634 | ||
635 | dprintk("--> %s\n", __func__); | 635 | dprintk("--> %s\n", __func__); |
636 | 636 | ||
637 | BUG_ON(ctx == NULL); | ||
638 | lgp = kzalloc(sizeof(*lgp), gfp_flags); | 637 | lgp = kzalloc(sizeof(*lgp), gfp_flags); |
639 | if (lgp == NULL) | 638 | if (lgp == NULL) |
640 | return NULL; | 639 | return NULL; |
@@ -1115,7 +1114,6 @@ pnfs_update_layout(struct inode *ino, | |||
1115 | * chance of a CB_LAYOUTRECALL(FILE) coming in. | 1114 | * chance of a CB_LAYOUTRECALL(FILE) coming in. |
1116 | */ | 1115 | */ |
1117 | spin_lock(&clp->cl_lock); | 1116 | spin_lock(&clp->cl_lock); |
1118 | BUG_ON(!list_empty(&lo->plh_layouts)); | ||
1119 | list_add_tail(&lo->plh_layouts, &server->layouts); | 1117 | list_add_tail(&lo->plh_layouts, &server->layouts); |
1120 | spin_unlock(&clp->cl_lock); | 1118 | spin_unlock(&clp->cl_lock); |
1121 | } | 1119 | } |
@@ -1211,7 +1209,7 @@ pnfs_generic_pg_init_read(struct nfs_pageio_descriptor *pgio, struct nfs_page *r | |||
1211 | { | 1209 | { |
1212 | u64 rd_size = req->wb_bytes; | 1210 | u64 rd_size = req->wb_bytes; |
1213 | 1211 | ||
1214 | BUG_ON(pgio->pg_lseg != NULL); | 1212 | WARN_ON_ONCE(pgio->pg_lseg != NULL); |
1215 | 1213 | ||
1216 | if (req->wb_offset != req->wb_pgbase) { | 1214 | if (req->wb_offset != req->wb_pgbase) { |
1217 | nfs_pageio_reset_read_mds(pgio); | 1215 | nfs_pageio_reset_read_mds(pgio); |
@@ -1240,7 +1238,7 @@ void | |||
1240 | pnfs_generic_pg_init_write(struct nfs_pageio_descriptor *pgio, | 1238 | pnfs_generic_pg_init_write(struct nfs_pageio_descriptor *pgio, |
1241 | struct nfs_page *req, u64 wb_size) | 1239 | struct nfs_page *req, u64 wb_size) |
1242 | { | 1240 | { |
1243 | BUG_ON(pgio->pg_lseg != NULL); | 1241 | WARN_ON_ONCE(pgio->pg_lseg != NULL); |
1244 | 1242 | ||
1245 | if (req->wb_offset != req->wb_pgbase) { | 1243 | if (req->wb_offset != req->wb_pgbase) { |
1246 | nfs_pageio_reset_write_mds(pgio); | 1244 | nfs_pageio_reset_write_mds(pgio); |