]> Pileus Git - ~andy/linux/blobdiff - drivers/md/dm-mpath.c
[PATCH] device-mapper multipath: Barriers not supported
[~andy/linux] / drivers / md / dm-mpath.c
index 1e97b3c12bd5dae147963fa7331ae3512554538d..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);
 
@@ -985,6 +988,12 @@ static int do_end_io(struct multipath *m, struct bio *bio,
        if (!error)
                return 0;       /* I/O complete */
 
+       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) {