Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm...
[firefly-linux-kernel-4.4.55.git] / fs / exofs / ore.c
index 1585db1aa3651a3eb2fbe586156fd5bd270f5b82..f936cb50dc0d524250dae6d6ac5382db5c1f25b7 100644 (file)
@@ -814,8 +814,8 @@ static int _write_mirror(struct ore_io_state *ios, int cur_comp)
                        struct bio *bio;
 
                        if (per_dev != master_dev) {
-                               bio = bio_kmalloc(GFP_KERNEL,
-                                                 master_dev->bio->bi_max_vecs);
+                               bio = bio_clone_kmalloc(master_dev->bio,
+                                                       GFP_KERNEL);
                                if (unlikely(!bio)) {
                                        ORE_DBGMSG(
                                              "Failed to allocate BIO size=%u\n",
@@ -824,7 +824,6 @@ static int _write_mirror(struct ore_io_state *ios, int cur_comp)
                                        goto out;
                                }
 
-                               __bio_clone(bio, master_dev->bio);
                                bio->bi_bdev = NULL;
                                bio->bi_next = NULL;
                                per_dev->offset = master_dev->offset;