]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Switch calculations of read_offset and write_offset
authorNeilBrown <neilb@suse.de>
Tue, 11 Jan 2011 03:57:14 +0000 (14:57 +1100)
committerNeilBrown <neilb@suse.de>
Tue, 11 Jan 2011 03:57:14 +0000 (14:57 +1100)
These were backwards...  we read from 'before' and write to 'after'.

Signed-off-by: NeilBrown <neilb@suse.de>
Grow.c

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