fix array_size in child_monitor

The array_size we need to consider is the largest possible size of the
array, which is a different calculation depending on whether the array
is growing or shrinking.

Signed-off-by: NeilBrown <neilb@suse.de>
This commit is contained in:
NeilBrown 2011-01-12 10:37:26 +11:00
parent 92d1991fff
commit 9653307272
1 changed files with 2 additions and 1 deletions

3
Grow.c
View File

@ -2758,11 +2758,12 @@ static int child_monitor(int afd, struct mdinfo *sra, struct reshape *reshape,
sysfs_set_num(sra, NULL, "sync_speed_min", 200000);
}
array_size = sra->component_size * data;
if (increasing) {
array_size = sra->component_size * reshape->after.data_disks;
backup_point = sra->reshape_progress;
suspend_point = 0;
} else {
array_size = sra->component_size * reshape->before.data_disks;
backup_point = array_size;
suspend_point = array_size;
}