[PATCH] WORKAROUND: mdadm hangs during reshape (PART #2)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

 Grow.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/Grow.c b/Grow.c
index bc015c6..c7e40c0 100644
--- a/Grow.c
+++ b/Grow.c
@@ -2466,6 +2466,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);

--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux