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

Commit 52b1fd5a authored by Mikulas Patocka's avatar Mikulas Patocka Committed by Alasdair G Kergon
Browse files

dm: send empty barriers to targets in dm_flush



Pass empty barrier flushes to the targets in dm_flush().

Signed-off-by: default avatarMikulas Patocka <mpatocka@redhat.com>
Signed-off-by: default avatarAlasdair G Kergon <agk@redhat.com>
parent 9015df24
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -164,6 +164,9 @@ struct mapped_device {

	/* sysfs handle */
	struct kobject kobj;

	/* zero-length barrier that will be cloned and submitted to targets */
	struct bio barrier_bio;
};

#define MIN_IOS 256
@@ -1477,6 +1480,13 @@ static int dm_wait_for_completion(struct mapped_device *md, int interruptible)
static void dm_flush(struct mapped_device *md)
{
	dm_wait_for_completion(md, TASK_UNINTERRUPTIBLE);

	bio_init(&md->barrier_bio);
	md->barrier_bio.bi_bdev = md->bdev;
	md->barrier_bio.bi_rw = WRITE_BARRIER;
	__split_and_process_bio(md, &md->barrier_bio);

	dm_wait_for_completion(md, TASK_UNINTERRUPTIBLE);
}

static void process_barrier(struct mapped_device *md, struct bio *bio)