analyse_change fixes

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>
This commit is contained in:
NeilBrown 2011-01-11 14:41:46 +11:00
parent b6b951557d
commit 4a8703648a
1 changed files with 4 additions and 5 deletions

9
Grow.c
View File

@ -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;