]> err.no Git - linux-2.6/blobdiff - drivers/md/multipath.c
[ARM] 3008/1: the exception table is not read-only
[linux-2.6] / drivers / md / multipath.c
index 4e4bfde3db5db8baadd5fe0242f018990970715c..1151c3ed300677e2be0fbed012ab27052527afb6 100644 (file)
@@ -38,7 +38,7 @@
 static mdk_personality_t multipath_personality;
 
 
-static void *mp_pool_alloc(unsigned int __nocast gfp_flags, void *data)
+static void *mp_pool_alloc(gfp_t gfp_flags, void *data)
 {
        struct multipath_bh *mpb;
        mpb = kmalloc(sizeof(*mpb), gfp_flags);
@@ -169,6 +169,11 @@ static int multipath_make_request (request_queue_t *q, struct bio * bio)
        struct multipath_bh * mp_bh;
        struct multipath_info *multipath;
 
+       if (unlikely(bio_barrier(bio))) {
+               bio_endio(bio, bio->bi_size, -EOPNOTSUPP);
+               return 0;
+       }
+
        mp_bh = mempool_alloc(conf->pool, GFP_NOIO);
 
        mp_bh->master_bio = bio;
@@ -462,10 +467,6 @@ static int multipath_run (mddev_t *mddev)
        }
        memset(conf->multipaths, 0, sizeof(struct multipath_info)*mddev->raid_disks);
 
-       mddev->queue->unplug_fn = multipath_unplug;
-
-       mddev->queue->issue_flush_fn = multipath_issue_flush;
-
        conf->working_disks = 0;
        ITERATE_RDEV(mddev,rdev,tmp) {
                disk_idx = rdev->raid_disk;
@@ -528,13 +529,16 @@ static int multipath_run (mddev_t *mddev)
         * Ok, everything is just fine now
         */
        mddev->array_size = mddev->size;
+
+       mddev->queue->unplug_fn = multipath_unplug;
+       mddev->queue->issue_flush_fn = multipath_issue_flush;
+
        return 0;
 
 out_free_conf:
        if (conf->pool)
                mempool_destroy(conf->pool);
-       if (conf->multipaths)
-               kfree(conf->multipaths);
+       kfree(conf->multipaths);
        kfree(conf);
        mddev->private = NULL;
 out: