Skip to content

Commit

Permalink
drbd: Remove some useless paranoia code
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Andreas Gruenbacher authored and Philipp Reisner committed Aug 29, 2011
1 parent 841ce24 commit 70dc65e
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions drivers/block/drbd/drbd_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 70dc65e

Please sign in to comment.