]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
analyse_change fixes
authorNeilBrown <neilb@suse.de>
Tue, 11 Jan 2011 03:41:46 +0000 (14:41 +1100)
committerNeilBrown <neilb@suse.de>
Tue, 11 Jan 2011 03:41:46 +0000 (14:41 +1100)
When converting to RAID6, the new layout should match the old
layout, not the RAID6 version of the old layout.

Signed-off-by: NeilBrown <neilb@suse.de>
Grow.c

diff --git a/Grow.c b/Grow.c
index d36cb3c53404db82ef990e931be40c319dac397b..d501d25756f8cecc2fcff4572bea5ef733ddff5c 100644 (file)
--- a/Grow.c
+++ b/Grow.c
@@ -1190,10 +1190,9 @@ char *analyse_change(struct mdinfo *info, struct reshape *re)
                                re->after.layout = info->new_layout;
                        break;
                case 6:
-                       if (info->new_layout == UnSet) {
-                               re->after.layout = re->before.layout;
-                               break;
-                       }
+                       if (info->new_layout == UnSet)
+                               info->new_layout = re->before.layout;
+
                        /* after.layout needs to be raid6 version of new_layout */
                        if (info->new_layout == ALGORITHM_PARITY_N)
                                re->after.layout = ALGORITHM_PARITY_N;
@@ -1221,7 +1220,7 @@ char *analyse_change(struct mdinfo *info, struct reshape *re)
                        re->after.data_disks = (info->array.raid_disks +
                                                info->delta_disks) - 2;
                if (info->new_layout == UnSet)
-                       re->after.layout = re->before.layout;
+                       re->after.layout = info->array.layout;
                else
                        re->after.layout = info->new_layout;
                break;