From: NeilBrown Date: Tue, 11 Jan 2011 03:57:14 +0000 (+1100) Subject: Switch calculations of read_offset and write_offset X-Git-Tag: mdadm-3.2~111 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ec757320c24df8041b7cb56c1d9dd512e99e7043;p=thirdparty%2Fmdadm.git Switch calculations of read_offset and write_offset These were backwards... we read from 'before' and write to 'after'. Signed-off-by: NeilBrown --- diff --git a/Grow.c b/Grow.c index 0f15e119..157ca580 100644 --- a/Grow.c +++ b/Grow.c @@ -2313,8 +2313,8 @@ int progress_reshape(struct mdinfo *info, struct reshape *reshape, * If we need to suspend more, we limit it to 128M per device, which is * rather arbitrary and should be some time-based calculation. */ - write_offset = info->reshape_progress / reshape->before.data_disks; - read_offset = info->reshape_progress / reshape->after.data_disks; + read_offset = info->reshape_progress / reshape->before.data_disks; + write_offset = info->reshape_progress / reshape->after.data_disks; write_range = info->new_chunk/512; if (advancing) { if (read_offset < write_offset + write_range) {