|
@@ -3940,7 +3940,8 @@ static sector_t reshape_request(mddev_t *mddev, sector_t sector_nr, int *skipped
|
|
* then we need to write out the superblock.
|
|
* then we need to write out the superblock.
|
|
*/
|
|
*/
|
|
sector_nr += reshape_sectors;
|
|
sector_nr += reshape_sectors;
|
|
- if (sector_nr >= mddev->resync_max) {
|
|
|
|
|
|
+ if ((sector_nr - mddev->curr_resync_completed) * 2
|
|
|
|
+ >= mddev->resync_max - mddev->curr_resync_completed) {
|
|
/* Cannot proceed until we've updated the superblock... */
|
|
/* Cannot proceed until we've updated the superblock... */
|
|
wait_event(conf->wait_for_overlap,
|
|
wait_event(conf->wait_for_overlap,
|
|
atomic_read(&conf->reshape_stripes) == 0);
|
|
atomic_read(&conf->reshape_stripes) == 0);
|