From: NeilBrown Date: Thu, 20 Jan 2011 21:56:35 +0000 (+1100) Subject: Initialise reshape_progress properly in reshape_array. X-Git-Tag: mdadm-3.2~66 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ddee071d3e19c4127bb2b4cd24ef79438e84e054;p=thirdparty%2Fmdadm.git Initialise reshape_progress properly in reshape_array. Previously uninitialised. Signed-off-by: NeilBrown --- diff --git a/Grow.c b/Grow.c index 9d3e482f..bf8e8ad3 100644 --- a/Grow.c +++ b/Grow.c @@ -1869,9 +1869,15 @@ started: sync_metadata(st); sra->new_chunk = info->new_chunk; + + sra->reshape_progress = 0; + if (reshape.after.data_disks < reshape.before.data_disks) + /* start from the end of the new array */ + sra->reshape_progress = (sra->component_size + * reshape.after.data_disks); if (info->reshape_active) - /* nothing needed here */; + sra->reshape_progress = info->reshape_progress; else if (info->array.chunk_size == info->new_chunk && reshape.before.layout == reshape.after.layout && st->ss->external == 0) { @@ -2274,11 +2280,10 @@ int progress_reshape(struct mdinfo *info, struct reshape *reshape, if (advancing) { if (read_offset < write_offset + write_range) max_progress = backup_point; - else { + else max_progress = read_offset * reshape->after.data_disks; - } } else { if (read_offset > write_offset - write_range) /* Can only progress as far as has been backed up,