]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
rbd: convert all rbd_assert(0) to BUG()
authorArnd Bergmann <arnd@arndb.de>
Fri, 22 Mar 2019 16:53:56 +0000 (17:53 +0100)
committerIlya Dryomov <idryomov@gmail.com>
Tue, 7 May 2019 17:22:37 +0000 (19:22 +0200)
rbd_assert(0) has caused different issues depending on
the compiler version in the past, so it seems better to avoid it
completely.

Replace the remaining instances.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Ilya Dryomov <idryomov@gmail.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
drivers/block/rbd.c

index 414037fef3ef779498a4cd36a4480eacf7b24cfa..612e4aecfa7f6e374e25e84774a136d71639fa2a 100644 (file)
@@ -1326,7 +1326,7 @@ static void rbd_obj_zero_range(struct rbd_obj_request *obj_req, u32 off,
                zero_bvecs(&obj_req->bvec_pos, off, bytes);
                break;
        default:
-               rbd_assert(0);
+               BUG();
        }
 }
 
@@ -1581,7 +1581,7 @@ static void rbd_obj_request_destroy(struct kref *kref)
                kfree(obj_request->bvec_pos.bvecs);
                break;
        default:
-               rbd_assert(0);
+               BUG();
        }
 
        kfree(obj_request->img_extents);
@@ -1781,7 +1781,7 @@ static void rbd_osd_req_setup_data(struct rbd_obj_request *obj_req, u32 which)
                                                    &obj_req->bvec_pos);
                break;
        default:
-               rbd_assert(0);
+               BUG();
        }
 }
 
@@ -2036,7 +2036,7 @@ static int __rbd_img_fill_request(struct rbd_img_request *img_req)
                        ret = rbd_obj_setup_zeroout(obj_req);
                        break;
                default:
-                       rbd_assert(0);
+                       BUG();
                }
                if (ret < 0)
                        return ret;
@@ -2515,7 +2515,7 @@ static int rbd_obj_issue_copyup_ops(struct rbd_obj_request *obj_req, u32 bytes)
                num_osd_ops += count_zeroout_ops(obj_req);
                break;
        default:
-               rbd_assert(0);
+               BUG();
        }
 
        obj_req->osd_req = rbd_osd_req_create(obj_req, num_osd_ops);
@@ -2542,7 +2542,7 @@ static int rbd_obj_issue_copyup_ops(struct rbd_obj_request *obj_req, u32 bytes)
                __rbd_obj_setup_zeroout(obj_req, which);
                break;
        default:
-               rbd_assert(0);
+               BUG();
        }
 
        ret = ceph_osdc_alloc_messages(obj_req->osd_req, GFP_NOIO);