From 2f3dd5e4bc8a7b895cf450294cbad9a3215311e0 Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Tue, 11 Jan 2011 15:07:57 +1100 Subject: [PATCH] Remove write_range from calculation of max_progress It isn't needed as we always work in multiples of full destination stripes. Also multiply by 'after' disks, not before. We can progress until the point we would write then lines up with where we would read now. We read now from array-address: reshape_progress device-address: read_offset So we write then to device-address: read_offset array-address: read_offset * after.disks Signed-off-by: NeilBrown --- Grow.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Grow.c b/Grow.c index 157ca580..f54d10de 100644 --- a/Grow.c +++ b/Grow.c @@ -2323,8 +2323,8 @@ int progress_reshape(struct mdinfo *info, struct reshape *reshape, need_backup = 1; } else { max_progress = - (read_offset - write_range) * - reshape->before.data_disks; + read_offset * + reshape->after.data_disks; } } else { if (read_offset > write_offset - write_range) { @@ -2333,8 +2333,8 @@ int progress_reshape(struct mdinfo *info, struct reshape *reshape, need_backup = 1; } else { max_progress = - (read_offset + write_range) * - reshape->before.data_disks; + read_offset * + reshape->after.data_disks; /* If we are using internal metadata, then we can * progress all the way to the suspend_point without * worrying about backing-up/suspending along the -- 2.39.2