]> git.baikalelectronics.ru Git - kernel.git/commit
md: limit mdstat resync progress to max_sectors
authorNate Dailey <nate.dailey@stratus.com>
Thu, 30 Nov 2017 16:33:30 +0000 (11:33 -0500)
committerShaohua Li <shli@fb.com>
Fri, 1 Dec 2017 20:19:47 +0000 (12:19 -0800)
commit0ff0c63921a904f56ac9b853bec3fc3929d104c1
tree84c377a418d8bccf0b2a26185732aa0096d8273d
parenta5123e771683b5d92b4e7c4b0873fc738899c4f9
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 <nate.dailey@stratus.com>
Acked-by: Guoqing Jiang <gqjiang@suse.com>
Signed-off-by: Shaohua Li <shli@fb.com>
drivers/md/md.c