From 4a8703648aaf40a53f73298bd1351ea92682ee52 Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Tue, 11 Jan 2011 14:41:46 +1100 Subject: [PATCH] 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 --- Grow.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Grow.c b/Grow.c index d36cb3c5..d501d257 100644 --- 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; -- 2.39.2