md/raid1: Avoid raid1 resync getting stuck

close_sync() needs to set conf->next_resync to a large, but safe value
below MaxSector and use it to determine whether or not to set
start_next_window in wait_barrier()

Solution suggested by Neil Brown.

Reported-by: Nate Dailey <>
Tested-by: Xiao Ni <>
Signed-off-by: Jes Sorensen <>
Signed-off-by: NeilBrown <>
1 file changed