[dm-devel] [PATCH 5/4] dm raid: revert recovery offset definition

Heinz Mauelshagen heinzm at redhat.com
Tue Oct 1 20:37:47 UTC 2019


Previous patch "dm raid: streamline rs_get_progress() and its
raid_status() caller side" mistakenly simplified the definition
of the recovery offset.  This caused the offset to immediately be
resync maximum when checks or repairs are requested.

Revert to the old definition.

Signed-off-by: Heinz Mauelshagen <heinzm at redhat.com>
---
 drivers/md/dm-raid.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/md/dm-raid.c b/drivers/md/dm-raid.c
index 63a4a26fae3e..13fa90546a0f 100644
--- a/drivers/md/dm-raid.c
+++ b/drivers/md/dm-raid.c
@@ -3426,7 +3426,10 @@ static sector_t rs_get_progress(struct raid_set *rs, unsigned long recovery,
 		set_bit(RT_FLAG_RS_IN_SYNC, &rs->runtime_flags);
 
 	} else {
-		r = max(mddev->recovery_cp, mddev->curr_resync_completed);
+		if (state == st_idle && !test_bit(MD_RECOVERY_INTR, &recovery))
+			r = mddev->recovery_cp;
+		else
+			r = mddev->curr_resync_completed;
 
 		if (state == st_idle && r >= resync_max_sectors) {
 			/*
-- 
2.21.0




More information about the dm-devel mailing list