diff mbox series

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

Message ID 53c8e7d1576cb4471cb399a3630d021087a150f3.1569962154.git.heinzm@redhat.com (mailing list archive)
State Accepted, archived
Delegated to: Mike Snitzer
Headers show
Series None | expand

Commit Message

Heinz Mauelshagen Oct. 1, 2019, 8:37 p.m. UTC
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@redhat.com>
---
 drivers/md/dm-raid.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
diff mbox series

Patch

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) {
 			/*