From: Philipp Reisner Date: Mon, 4 Jul 2011 09:14:31 +0000 (+0200) Subject: drbd: Keep a reference to the bio until the completion handler finished X-Git-Tag: firefly_0821_release~3680^2~2719^2^2~51 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=4a2fe568b5428abc56d7d172e3571e33d8ab7265;p=firefly-linux-kernel-4.4.55.git drbd: Keep a reference to the bio until the completion handler finished Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- diff --git a/drivers/block/drbd/drbd_actlog.c b/drivers/block/drbd/drbd_actlog.c index aee599fad960..528342c82ba1 100644 --- a/drivers/block/drbd/drbd_actlog.c +++ b/drivers/block/drbd/drbd_actlog.c @@ -118,6 +118,7 @@ static int _drbd_md_sync_page_io(struct drbd_conf *mdev, bio->bi_end_io = drbd_md_io_complete; bio->bi_rw = rw; + bio_get(bio); /* one bio_put() is in the completion handler */ atomic_inc(&mdev->md_io_in_use); /* drbd_md_put_buffer() is in the completion handler */ if (drbd_insert_fault(mdev, (rw & WRITE) ? DRBD_FAULT_MD_WR : DRBD_FAULT_MD_RD)) bio_endio(bio, -EIO); diff --git a/drivers/block/drbd/drbd_worker.c b/drivers/block/drbd/drbd_worker.c index ee8303680dd8..6dcd9f6e78c8 100644 --- a/drivers/block/drbd/drbd_worker.c +++ b/drivers/block/drbd/drbd_worker.c @@ -79,6 +79,7 @@ void drbd_md_io_complete(struct bio *bio, int error) md_io->done = 1; wake_up(&mdev->misc_wait); + bio_put(bio); drbd_md_put_buffer(mdev); }