Grow: round max_progress to old chunk size too.

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>
This commit is contained in:
NeilBrown 2011-01-31 17:04:37 +11:00
parent 0d711ba4d3
commit 7f913e9b21
1 changed files with 3 additions and 0 deletions

3
Grow.c
View File

@ -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;