]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Grow: round max_progress to old chunk size too.
authorNeilBrown <neilb@suse.de>
Mon, 31 Jan 2011 06:04:37 +0000 (17:04 +1100)
committerNeilBrown <neilb@suse.de>
Mon, 31 Jan 2011 06:04:37 +0000 (17:04 +1100)
kernel requires sync_max to be a multiple of the current
chunk size.  This is not really 'correct', but we need to work
with it.  So round down.

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

diff --git a/Grow.c b/Grow.c
index b81f09eb9dadc57394d163715805252e671d7846..748fbf68d134564618be3a1708d760913fdd8322 100644 (file)
--- a/Grow.c
+++ b/Grow.c
@@ -2429,6 +2429,9 @@ int progress_reshape(struct mdinfo *info, struct reshape *reshape,
        /* Round to chunk size as some kernels give an erroneously high number */
        max_progress /= info->new_chunk/512;
        max_progress *= info->new_chunk/512;
+       /* And round to old chunk size as the kernel wants that */
+       max_progress /= info->array.chunk_size/512;
+       max_progress *= info->array.chunk_size/512;
        /* Limit progress to the whole device */
        if (max_progress > info->component_size)
                max_progress = info->component_size;