From 031d445c18a91eb140ce87cd05b0d3fec1f1b215 Mon Sep 17 00:00:00 2001 From: Krzysztof Wojcik Date: Mon, 17 Jan 2011 12:53:31 +1100 Subject: [PATCH] Set reshape.after.data_disks for raid0<->raid10 takeover reshape.after.data_disks field must be initiated for raid0<->raid10 transition. Instead calculated spares_needed variable in reshape_array function has random value. Signed-off-by: Krzysztof Wojcik Signed-off-by: NeilBrown --- Grow.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Grow.c b/Grow.c index 447e87e..e9a2674 100644 --- a/Grow.c +++ b/Grow.c @@ -970,6 +970,7 @@ char *analyse_change(struct mdinfo *info, struct reshape *re) re->level = 0; re->parity = 0; re->before.data_disks = new_disks; + re->after.data_disks = re->before.data_disks; re->before.layout = 0; re->backup_blocks = 0; return NULL; @@ -1007,6 +1008,7 @@ char *analyse_change(struct mdinfo *info, struct reshape *re) re->parity = 0; re->before.data_disks = (info->array.raid_disks + info->delta_disks); + re->after.data_disks = re->before.data_disks; re->before.layout = info->new_layout; re->backup_blocks = 0; return NULL;