diff options
author | Philipp Reisner <philipp.reisner@linbit.com> | 2011-06-27 06:23:33 -0400 |
---|---|---|
committer | Philipp Reisner <philipp.reisner@linbit.com> | 2012-05-09 04:31:11 -0400 |
commit | b2057629ea96c33e4ae38102ecd0f27ed9a3c3ef (patch) | |
tree | 6b7723e1aab29c4e83377168cf26482447d788eb /drivers/block/drbd/drbd_actlog.c | |
parent | 4a2fe568b5428abc56d7d172e3571e33d8ab7265 (diff) |
drbd: Hold a reference to ldev while doing meta-data IO
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
Diffstat (limited to 'drivers/block/drbd/drbd_actlog.c')
-rw-r--r-- | drivers/block/drbd/drbd_actlog.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/block/drbd/drbd_actlog.c b/drivers/block/drbd/drbd_actlog.c index 528342c82ba1..3d7c2153daca 100644 --- a/drivers/block/drbd/drbd_actlog.c +++ b/drivers/block/drbd/drbd_actlog.c | |||
@@ -118,6 +118,12 @@ static int _drbd_md_sync_page_io(struct drbd_conf *mdev, | |||
118 | bio->bi_end_io = drbd_md_io_complete; | 118 | bio->bi_end_io = drbd_md_io_complete; |
119 | bio->bi_rw = rw; | 119 | bio->bi_rw = rw; |
120 | 120 | ||
121 | if (!get_ldev_if_state(mdev, D_ATTACHING)) { /* Corresponding put_ldev in drbd_md_io_complete() */ | ||
122 | dev_err(DEV, "ASSERT FAILED: get_ldev_if_state() == 1 in _drbd_md_sync_page_io()\n"); | ||
123 | ok = 0; | ||
124 | goto out; | ||
125 | } | ||
126 | |||
121 | bio_get(bio); /* one bio_put() is in the completion handler */ | 127 | bio_get(bio); /* one bio_put() is in the completion handler */ |
122 | atomic_inc(&mdev->md_io_in_use); /* drbd_md_put_buffer() is in the completion handler */ | 128 | atomic_inc(&mdev->md_io_in_use); /* drbd_md_put_buffer() is in the completion handler */ |
123 | if (drbd_insert_fault(mdev, (rw & WRITE) ? DRBD_FAULT_MD_WR : DRBD_FAULT_MD_RD)) | 129 | if (drbd_insert_fault(mdev, (rw & WRITE) ? DRBD_FAULT_MD_WR : DRBD_FAULT_MD_RD)) |