]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
NFSv4.1: Remove assertion BUG_ON()s from the files and generic layout code
authorTrond Myklebust <Trond.Myklebust@netapp.com>
Mon, 15 Oct 2012 18:58:04 +0000 (14:58 -0400)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Wed, 31 Oct 2012 20:27:26 +0000 (16:27 -0400)
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
fs/nfs/nfs4filelayout.c
fs/nfs/nfs4filelayoutdev.c
fs/nfs/pnfs.c

index 2e45fd9c02a38cc9d7b3ee0ee87150fa3a8e7ea8..bfb28fa38e74f841243cbe49292a9faa9e795a1e 100644 (file)
@@ -512,7 +512,6 @@ filelayout_read_pagelist(struct nfs_read_data *data)
        loff_t offset = data->args.offset;
        u32 j, idx;
        struct nfs_fh *fh;
-       int status;
 
        dprintk("--> %s ino %lu pgbase %u req %Zu@%llu\n",
                __func__, hdr->inode->i_ino,
@@ -538,9 +537,8 @@ filelayout_read_pagelist(struct nfs_read_data *data)
        data->mds_offset = offset;
 
        /* 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);
-       BUG_ON(status != 0);
        return PNFS_ATTEMPTED;
 }
 
@@ -554,7 +552,6 @@ filelayout_write_pagelist(struct nfs_write_data *data, int sync)
        loff_t offset = data->args.offset;
        u32 j, idx;
        struct nfs_fh *fh;
-       int status;
 
        /* Retrieve the correct rpc_client for the byte range */
        j = nfs4_fl_calc_j_index(lseg, offset);
@@ -579,10 +576,9 @@ filelayout_write_pagelist(struct nfs_write_data *data, int sync)
        data->args.offset = filelayout_get_dserver_offset(lseg, offset);
 
        /* 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,
                                    RPC_TASK_SOFTCONN);
-       BUG_ON(status != 0);
        return PNFS_ATTEMPTED;
 }
 
@@ -909,7 +905,7 @@ static void
 filelayout_pg_init_read(struct nfs_pageio_descriptor *pgio,
                        struct nfs_page *req)
 {
-       BUG_ON(pgio->pg_lseg != NULL);
+       WARN_ON_ONCE(pgio->pg_lseg != NULL);
 
        if (req->wb_offset != req->wb_pgbase) {
                /*
@@ -939,7 +935,7 @@ filelayout_pg_init_write(struct nfs_pageio_descriptor *pgio,
        struct nfs_commit_info cinfo;
        int status;
 
-       BUG_ON(pgio->pg_lseg != NULL);
+       WARN_ON_ONCE(pgio->pg_lseg != NULL);
 
        if (req->wb_offset != req->wb_pgbase)
                goto out_mds;
@@ -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++) {
                if (transfer_commit_list(&b->written, dst, cinfo, 0)) {
-                       BUG_ON(!list_empty(&b->written));
                        pnfs_put_lseg(b->wlseg);
                        b->wlseg = NULL;
                }
index a8eaa9b7bb0f2c8fc704b8eb752c2ebc564b52bf..93e2530d7098708833ec336127f3e64f3a4662a2 100644 (file)
@@ -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,
                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) {
                dprintk("%s: DS %s: trying address %s\n",
                        __func__, ds->ds_remotestr, da->da_remotestr);
index dcbc9b20474b88b9bfb9163e1c88ad56e1a5ecc2..e7165d915362838ab485e51ddde95db97ecd96c0 100644 (file)
@@ -634,7 +634,6 @@ send_layoutget(struct pnfs_layout_hdr *lo,
 
        dprintk("--> %s\n", __func__);
 
-       BUG_ON(ctx == NULL);
        lgp = kzalloc(sizeof(*lgp), gfp_flags);
        if (lgp == NULL)
                return NULL;
@@ -1115,7 +1114,6 @@ pnfs_update_layout(struct inode *ino,
                 * chance of a CB_LAYOUTRECALL(FILE) coming in.
                 */
                spin_lock(&clp->cl_lock);
-               BUG_ON(!list_empty(&lo->plh_layouts));
                list_add_tail(&lo->plh_layouts, &server->layouts);
                spin_unlock(&clp->cl_lock);
        }
@@ -1211,7 +1209,7 @@ pnfs_generic_pg_init_read(struct nfs_pageio_descriptor *pgio, struct nfs_page *r
 {
        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) {
                nfs_pageio_reset_read_mds(pgio);
@@ -1240,7 +1238,7 @@ void
 pnfs_generic_pg_init_write(struct nfs_pageio_descriptor *pgio,
                           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) {
                nfs_pageio_reset_write_mds(pgio);