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

Commit f6a80ea8 authored by Alasdair G Kergon's avatar Alasdair G Kergon Committed by Linus Torvalds
Browse files

[PATCH] device-mapper multipath: Barriers not supported



dm multipath will report barriers as not supported with this patch.

Signed-off-by: default avatarLars Marowsky-Bree <lmb@suse.de>
Signed-off-by: default avatarAlasdair G Kergon <agk@redhat.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 3f603ed3
Loading
Loading
Loading
Loading
+6 −0
Original line number Original line Diff line number Diff line
@@ -765,6 +765,9 @@ static int multipath_map(struct dm_target *ti, struct bio *bio,
	struct mpath_io *mpio;
	struct mpath_io *mpio;
	struct multipath *m = (struct multipath *) ti->private;
	struct multipath *m = (struct multipath *) ti->private;


	if (bio_barrier(bio))
		return -EOPNOTSUPP;

	mpio = mempool_alloc(m->mpio_pool, GFP_NOIO);
	mpio = mempool_alloc(m->mpio_pool, GFP_NOIO);
	dm_bio_record(&mpio->details, bio);
	dm_bio_record(&mpio->details, bio);


@@ -988,6 +991,9 @@ static int do_end_io(struct multipath *m, struct bio *bio,
	if ((error == -EWOULDBLOCK) && bio_rw_ahead(bio))
	if ((error == -EWOULDBLOCK) && bio_rw_ahead(bio))
		return error;
		return error;


	if (error == -EOPNOTSUPP)
		return error;

	spin_lock(&m->lock);
	spin_lock(&m->lock);
	if (!m->nr_valid_paths) {
	if (!m->nr_valid_paths) {
		if (!m->queue_if_no_path || m->suspended) {
		if (!m->queue_if_no_path || m->suspended) {
+1 −1
Original line number Original line Diff line number Diff line
@@ -777,7 +777,7 @@ static int snapshot_map(struct dm_target *ti, struct bio *bio,


	/* Full snapshots are not usable */
	/* Full snapshots are not usable */
	if (!s->valid)
	if (!s->valid)
		return -1;
		return -EIO;


	/*
	/*
	 * Write to snapshot - higher level takes care of RW/RO
	 * Write to snapshot - higher level takes care of RW/RO
+1 −1
Original line number Original line Diff line number Diff line
@@ -384,7 +384,7 @@ static void __map_bio(struct dm_target *ti, struct bio *clone,
		/* error the io and bail out */
		/* error the io and bail out */
		struct dm_io *io = tio->io;
		struct dm_io *io = tio->io;
		free_tio(tio->io->md, tio);
		free_tio(tio->io->md, tio);
		dec_pending(io, -EIO);
		dec_pending(io, r);
		bio_put(clone);
		bio_put(clone);
	}
	}
}
}