WORKAROUND: mdadm hangs during reshape (PART #2)

After loop can occurs that due to 0 value reported by kernel
we have 0 in completed variable.
This is wrong. we are interested in real completed point.
0 value means that we reached sync point set in md,
so we can set completed variable to just reached point.
this point value is stored in max_progress variable.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
This commit is contained in:
Adam Kwolek 2011-01-27 15:44:39 +01:00 committed by NeilBrown
parent fab32c9702
commit 10d0d365eb
1 changed files with 6 additions and 0 deletions

6
Grow.c
View File

@ -2468,6 +2468,12 @@ int progress_reshape(struct mdinfo *info, struct reshape *reshape,
goto check_progress;
}
}
/* Some kernels reset 'sync_completed' to zero,
* we need to have real point we are in md
*/
if (completed == 0)
completed = max_progress;
/* some kernels can give an incorrectly high 'completed' number */
completed /= (info->new_chunk/512);
completed *= (info->new_chunk/512);