Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4a2fe568 authored by Philipp Reisner's avatar Philipp Reisner
Browse files

drbd: Keep a reference to the bio until the completion handler finished

parent 0c464425
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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);
+1 −0
Original line number Diff line number Diff line
@@ -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);
}