]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Remove write_range from calculation of max_progress
authorNeilBrown <neilb@suse.de>
Tue, 11 Jan 2011 04:07:57 +0000 (15:07 +1100)
committerNeilBrown <neilb@suse.de>
Tue, 11 Jan 2011 04:07:57 +0000 (15:07 +1100)
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 <neilb@suse.de>
Grow.c

diff --git a/Grow.c b/Grow.c
index 157ca5801cf89d1c658642b97d072d962c49ddf0..f54d10de607d32c06e90354f81349d170c1f4015 100644 (file)
--- 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