]> err.no Git - linux-2.6/commitdiff
[PATCH] device-mapper multipath: Barriers not supported
authorAlasdair G Kergon <agk@redhat.com>
Tue, 12 Jul 2005 22:53:01 +0000 (15:53 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Tue, 12 Jul 2005 23:19:10 +0000 (16:19 -0700)
dm multipath will report barriers as not supported with this patch.

Signed-off-by: Lars Marowsky-Bree <lmb@suse.de>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
drivers/md/dm-mpath.c
drivers/md/dm-snap.c
drivers/md/dm.c

index 0c1b8520ef86f9105c20b45632eb00d9a114c8be..84cdb700a247040d4e72a7f79c03df12a7598ced 100644 (file)
@@ -765,6 +765,9 @@ static int multipath_map(struct dm_target *ti, struct bio *bio,
        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);
 
@@ -988,6 +991,9 @@ static int do_end_io(struct multipath *m, struct bio *bio,
        if ((error == -EWOULDBLOCK) && bio_rw_ahead(bio))
                return error;
 
+       if (error == -EOPNOTSUPP)
+               return error;
+
        spin_lock(&m->lock);
        if (!m->nr_valid_paths) {
                if (!m->queue_if_no_path || m->suspended) {
index 7e691ab9a748a665d8417a7865de59afd36a05bb..594d1f6b4789e7e864ae131987ebc078ed0bad23 100644 (file)
@@ -777,7 +777,7 @@ static int snapshot_map(struct dm_target *ti, struct bio *bio,
 
        /* Full snapshots are not usable */
        if (!s->valid)
-               return -1;
+               return -EIO;
 
        /*
         * Write to snapshot - higher level takes care of RW/RO
index f6b03957efc7b8bbd70f28f8ca1230b95ffeb4a3..5d40555b42ba564b63d4d068761442fe98a0fdf6 100644 (file)
@@ -384,7 +384,7 @@ static void __map_bio(struct dm_target *ti, struct bio *clone,
                /* 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);
        }
 }