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

Signed-off-by: Lars Marowsky-Bree <lmb@suse.de>

--- diff/drivers/md/dm-mpath.c	2005-04-21 17:32:53.000000000 +0100
+++ source/drivers/md/dm-mpath.c	2005-04-21 19:28:47.000000000 +0100
@@ -765,6 +765,9 @@
 	struct mpath_io *mpio;
 	struct multipath *m = (struct multipath *) ti->private;
 
+	if (bio_barrier(bio))
+		return -EOPNOTSUPP;
+
 	mpio = mempool_alloc(m->mpio_pool, GFP_NOIO);
 	dm_bio_record(&mpio->details, bio);
 
@@ -985,6 +988,9 @@
 	if (!error)
 		return 0;	/* I/O complete */
 
+	if (error == -EOPNOTSUPP)
+		return error;
+
 	spin_lock(&m->lock);
 	if (!m->nr_valid_paths) {
 		if (!m->queue_if_no_path || m->suspended) {
--- diff/drivers/md/dm-snap.c	2005-04-21 16:10:51.000000000 +0100
+++ source/drivers/md/dm-snap.c	2005-04-21 19:24:47.000000000 +0100
@@ -790,7 +790,7 @@
 
 	/* Full snapshots are not usable */
 	if (!s->valid)
-		return -1;
+		return -EIO;
 
 	/*
 	 * Write to snapshot - higher level takes care of RW/RO
--- diff/drivers/md/dm.c	2005-04-21 16:09:16.000000000 +0100
+++ source/drivers/md/dm.c	2005-04-21 19:24:47.000000000 +0100
@@ -384,7 +384,7 @@
 		/* error the io and bail out */
 		struct dm_io *io = tio->io;
 		free_tio(tio->io->md, tio);
-		dec_pending(io, -EIO);
+		dec_pending(io, r);
 		bio_put(clone);
 	}
 }
