drbd: Remove some useless paranoia code
authorAndreas Gruenbacher <agruen@linbit.com>
Tue, 21 Dec 2010 13:46:57 +0000 (14:46 +0100)
committerPhilipp Reisner <philipp.reisner@linbit.com>
Mon, 29 Aug 2011 09:26:58 +0000 (11:26 +0200)
The open_cnt check is an open-coded D_ASSERT() check.

In case the data.work queue is not empty, it does not really help to
know which drbd_work elements remained on that list: they will be freed
immediately afterwards, anyway.

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
drivers/block/drbd/drbd_main.c

index 46ba4aa03f3f6b8d3ba40e8c8e478c5aa3f2a33d..2902f6dd7bf1098c480121b295c16ac1f92ed459 100644 (file)
@@ -3254,16 +3254,8 @@ static void drbd_delete_device(unsigned int minor)
                return;
 
        /* paranoia asserts */
-       if (mdev->open_cnt != 0)
-               dev_err(DEV, "open_cnt = %d in %s:%u", mdev->open_cnt,
-                               __FILE__ , __LINE__);
-
-       if (!expect(list_empty(&mdev->data.work.q))) {
-               struct list_head *lp;
-               list_for_each(lp, &mdev->data.work.q) {
-                       dev_err(DEV, "lp = %p\n", lp);
-               }
-       };
+       D_ASSERT(mdev->open_cnt == 0);
+       D_ASSERT(list_empty(&mdev->data.work.q));
        /* end paranoia asserts */
 
        del_gendisk(mdev->vdisk);
This page took 0.041342 seconds and 5 git commands to generate.