summaryrefslogtreecommitdiff
path: root/Grow.c
diff options
context:
space:
mode:
authorAdam Kwolek <adam.kwolek@intel.com>2011-01-27 15:44:39 +0100
committerNeilBrown <neilb@suse.de>2011-01-28 11:03:11 +1000
commit10d0d365eb4b441664de136410655df8ab902806 (patch)
tree70f33817bc4e57003c2a4661d7514f6e6e248256 /Grow.c
parentfab32c97025672c3dc9876978e05d59609f73b75 (diff)
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>
Diffstat (limited to 'Grow.c')
-rw-r--r--Grow.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/Grow.c b/Grow.c
index 14a4f275..d7deb0f5 100644
--- a/Grow.c
+++ b/Grow.c
@@ -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);