Skip to content

Commit d2e2ec8

Browse files
nhdaileyshligit
authored andcommitted
md: limit mdstat resync progress to max_sectors
There is a small window near the end of md_do_sync where mddev->curr_resync can be equal to MaxSector. If status_resync is called during this window, the resulting /proc/mdstat output contains a HUGE number of = signs due to the very large curr_resync: Personalities : [raid1] md123 : active raid1 sdd3[2] sdb3[0] 204736 blocks super 1.0 [2/1] [U_] [===================================================================== ... (82 MB more) ... ================>] recovery =429496729.3% (9223372036854775807/204736) finish=0.2min speed=12796K/sec bitmap: 0/1 pages [0KB], 65536KB chunk Modify status_resync to ensure the resync variable doesn't exceed the array's max_sectors. Signed-off-by: Nate Dailey <[email protected]> Acked-by: Guoqing Jiang <[email protected]> Signed-off-by: Shaohua Li <[email protected]>
1 parent ff35f58 commit d2e2ec8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/md/md.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7605,7 +7605,9 @@ static int status_resync(struct seq_file *seq, struct mddev *mddev)
76057605
if (test_bit(MD_RECOVERY_DONE, &mddev->recovery))
76067606
/* Still cleaning up */
76077607
resync = max_sectors;
7608-
} else
7608+
} else if (resync > max_sectors)
7609+
resync = max_sectors;
7610+
else
76097611
resync -= atomic_read(&mddev->recovery_active);
76107612

76117613
if (resync == 0) {

0 commit comments

Comments
 (0)