Commit bc5a89b3 authored by Trond Myklebust's avatar Trond Myklebust

NFSv4.1: Remove assertion BUG_ON()s from the files and generic layout code

Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent eba24e1f
...@@ -512,7 +512,6 @@ filelayout_read_pagelist(struct nfs_read_data *data) ...@@ -512,7 +512,6 @@ filelayout_read_pagelist(struct nfs_read_data *data)
loff_t offset = data->args.offset; loff_t offset = data->args.offset;
u32 j, idx; u32 j, idx;
struct nfs_fh *fh; struct nfs_fh *fh;
int status;
dprintk("--> %s ino %lu pgbase %u req %Zu@%llu\n", dprintk("--> %s ino %lu pgbase %u req %Zu@%llu\n",
__func__, hdr->inode->i_ino, __func__, hdr->inode->i_ino,
...@@ -538,9 +537,8 @@ filelayout_read_pagelist(struct nfs_read_data *data) ...@@ -538,9 +537,8 @@ filelayout_read_pagelist(struct nfs_read_data *data)
data->mds_offset = offset; data->mds_offset = offset;
/* Perform an asynchronous read to ds */ /* Perform an asynchronous read to ds */
status = nfs_initiate_read(ds->ds_clp->cl_rpcclient, data, nfs_initiate_read(ds->ds_clp->cl_rpcclient, data,
&filelayout_read_call_ops, RPC_TASK_SOFTCONN); &filelayout_read_call_ops, RPC_TASK_SOFTCONN);
BUG_ON(status != 0);
return PNFS_ATTEMPTED; return PNFS_ATTEMPTED;
} }
...@@ -554,7 +552,6 @@ filelayout_write_pagelist(struct nfs_write_data *data, int sync) ...@@ -554,7 +552,6 @@ filelayout_write_pagelist(struct nfs_write_data *data, int sync)
loff_t offset = data->args.offset; loff_t offset = data->args.offset;
u32 j, idx; u32 j, idx;
struct nfs_fh *fh; struct nfs_fh *fh;
int status;
/* Retrieve the correct rpc_client for the byte range */ /* Retrieve the correct rpc_client for the byte range */
j = nfs4_fl_calc_j_index(lseg, offset); j = nfs4_fl_calc_j_index(lseg, offset);
...@@ -579,10 +576,9 @@ filelayout_write_pagelist(struct nfs_write_data *data, int sync) ...@@ -579,10 +576,9 @@ filelayout_write_pagelist(struct nfs_write_data *data, int sync)
data->args.offset = filelayout_get_dserver_offset(lseg, offset); data->args.offset = filelayout_get_dserver_offset(lseg, offset);
/* Perform an asynchronous write */ /* Perform an asynchronous write */
status = nfs_initiate_write(ds->ds_clp->cl_rpcclient, data, nfs_initiate_write(ds->ds_clp->cl_rpcclient, data,
&filelayout_write_call_ops, sync, &filelayout_write_call_ops, sync,
RPC_TASK_SOFTCONN); RPC_TASK_SOFTCONN);
BUG_ON(status != 0);
return PNFS_ATTEMPTED; return PNFS_ATTEMPTED;
} }
...@@ -909,7 +905,7 @@ static void ...@@ -909,7 +905,7 @@ static void
filelayout_pg_init_read(struct nfs_pageio_descriptor *pgio, filelayout_pg_init_read(struct nfs_pageio_descriptor *pgio,
struct nfs_page *req) struct nfs_page *req)
{ {
BUG_ON(pgio->pg_lseg != NULL); WARN_ON_ONCE(pgio->pg_lseg != NULL);
if (req->wb_offset != req->wb_pgbase) { if (req->wb_offset != req->wb_pgbase) {
/* /*
...@@ -939,7 +935,7 @@ filelayout_pg_init_write(struct nfs_pageio_descriptor *pgio, ...@@ -939,7 +935,7 @@ filelayout_pg_init_write(struct nfs_pageio_descriptor *pgio,
struct nfs_commit_info cinfo; struct nfs_commit_info cinfo;
int status; int status;
BUG_ON(pgio->pg_lseg != NULL); WARN_ON_ONCE(pgio->pg_lseg != NULL);
if (req->wb_offset != req->wb_pgbase) if (req->wb_offset != req->wb_pgbase)
goto out_mds; goto out_mds;
...@@ -1187,7 +1183,6 @@ static void filelayout_recover_commit_reqs(struct list_head *dst, ...@@ -1187,7 +1183,6 @@ static void filelayout_recover_commit_reqs(struct list_head *dst,
*/ */
for (i = 0, b = cinfo->ds->buckets; i < cinfo->ds->nbuckets; i++, b++) { for (i = 0, b = cinfo->ds->buckets; i < cinfo->ds->nbuckets; i++, b++) {
if (transfer_commit_list(&b->written, dst, cinfo, 0)) { if (transfer_commit_list(&b->written, dst, cinfo, 0)) {
BUG_ON(!list_empty(&b->written));
pnfs_put_lseg(b->wlseg); pnfs_put_lseg(b->wlseg);
b->wlseg = NULL; b->wlseg = NULL;
} }
......
...@@ -162,8 +162,6 @@ nfs4_ds_connect(struct nfs_server *mds_srv, struct nfs4_pnfs_ds *ds) ...@@ -162,8 +162,6 @@ nfs4_ds_connect(struct nfs_server *mds_srv, struct nfs4_pnfs_ds *ds)
dprintk("--> %s DS %s au_flavor %d\n", __func__, ds->ds_remotestr, dprintk("--> %s DS %s au_flavor %d\n", __func__, ds->ds_remotestr,
mds_srv->nfs_client->cl_rpcclient->cl_auth->au_flavor); mds_srv->nfs_client->cl_rpcclient->cl_auth->au_flavor);
BUG_ON(list_empty(&ds->ds_addrs));
list_for_each_entry(da, &ds->ds_addrs, da_node) { list_for_each_entry(da, &ds->ds_addrs, da_node) {
dprintk("%s: DS %s: trying address %s\n", dprintk("%s: DS %s: trying address %s\n",
__func__, ds->ds_remotestr, da->da_remotestr); __func__, ds->ds_remotestr, da->da_remotestr);
......
...@@ -634,7 +634,6 @@ send_layoutget(struct pnfs_layout_hdr *lo, ...@@ -634,7 +634,6 @@ send_layoutget(struct pnfs_layout_hdr *lo,
dprintk("--> %s\n", __func__); dprintk("--> %s\n", __func__);
BUG_ON(ctx == NULL);
lgp = kzalloc(sizeof(*lgp), gfp_flags); lgp = kzalloc(sizeof(*lgp), gfp_flags);
if (lgp == NULL) if (lgp == NULL)
return NULL; return NULL;
...@@ -1115,7 +1114,6 @@ pnfs_update_layout(struct inode *ino, ...@@ -1115,7 +1114,6 @@ pnfs_update_layout(struct inode *ino,
* chance of a CB_LAYOUTRECALL(FILE) coming in. * chance of a CB_LAYOUTRECALL(FILE) coming in.
*/ */
spin_lock(&clp->cl_lock); spin_lock(&clp->cl_lock);
BUG_ON(!list_empty(&lo->plh_layouts));
list_add_tail(&lo->plh_layouts, &server->layouts); list_add_tail(&lo->plh_layouts, &server->layouts);
spin_unlock(&clp->cl_lock); spin_unlock(&clp->cl_lock);
} }
...@@ -1211,7 +1209,7 @@ pnfs_generic_pg_init_read(struct nfs_pageio_descriptor *pgio, struct nfs_page *r ...@@ -1211,7 +1209,7 @@ pnfs_generic_pg_init_read(struct nfs_pageio_descriptor *pgio, struct nfs_page *r
{ {
u64 rd_size = req->wb_bytes; u64 rd_size = req->wb_bytes;
BUG_ON(pgio->pg_lseg != NULL); WARN_ON_ONCE(pgio->pg_lseg != NULL);
if (req->wb_offset != req->wb_pgbase) { if (req->wb_offset != req->wb_pgbase) {
nfs_pageio_reset_read_mds(pgio); nfs_pageio_reset_read_mds(pgio);
...@@ -1240,7 +1238,7 @@ void ...@@ -1240,7 +1238,7 @@ void
pnfs_generic_pg_init_write(struct nfs_pageio_descriptor *pgio, pnfs_generic_pg_init_write(struct nfs_pageio_descriptor *pgio,
struct nfs_page *req, u64 wb_size) struct nfs_page *req, u64 wb_size)
{ {
BUG_ON(pgio->pg_lseg != NULL); WARN_ON_ONCE(pgio->pg_lseg != NULL);
if (req->wb_offset != req->wb_pgbase) { if (req->wb_offset != req->wb_pgbase) {
nfs_pageio_reset_write_mds(pgio); nfs_pageio_reset_write_mds(pgio);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment