]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - drivers/md/raid10.c
md/raid10: fix two bugs affecting RAID10 reshape.
[karo-tx-linux.git] / drivers / md / raid10.c
index aa8ba0760cac35778dbd9c71dceea233fcd6f0b7..3480bf7c20d41b67a8d26057db8ff890126cf042 100644 (file)
@@ -3554,7 +3554,7 @@ static struct r10conf *setup_conf(struct mddev *mddev)
 
        /* FIXME calc properly */
        conf->mirrors = kzalloc(sizeof(struct raid10_info)*(mddev->raid_disks +
-                                                           max(0,mddev->delta_disks)),
+                                                           max(0,-mddev->delta_disks)),
                                GFP_KERNEL);
        if (!conf->mirrors)
                goto out;
@@ -3713,7 +3713,7 @@ static int run(struct mddev *mddev)
                    conf->geo.far_offset == 0)
                        goto out_free_conf;
                if (conf->prev.far_copies != 1 &&
-                   conf->geo.far_offset == 0)
+                   conf->prev.far_offset == 0)
                        goto out_free_conf;
        }