aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/md/md.c3
-rw-r--r--drivers/md/raid5.c3
2 files changed, 4 insertions, 2 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 7af64f3846a6..612343fdde94 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -6347,7 +6347,8 @@ void md_do_sync(mddev_t *mddev)
6347 if ((mddev->curr_resync > mddev->curr_resync_completed && 6347 if ((mddev->curr_resync > mddev->curr_resync_completed &&
6348 (mddev->curr_resync - mddev->curr_resync_completed) 6348 (mddev->curr_resync - mddev->curr_resync_completed)
6349 > (max_sectors >> 4)) || 6349 > (max_sectors >> 4)) ||
6350 j >= mddev->resync_max 6350 (j - mddev->curr_resync_completed)*2
6351 >= mddev->resync_max - mddev->curr_resync_completed
6351 ) { 6352 ) {
6352 /* time to update curr_resync_completed */ 6353 /* time to update curr_resync_completed */
6353 blk_unplug(mddev->queue); 6354 blk_unplug(mddev->queue);
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index 76892ac72544..4616bc3a6e71 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -3940,7 +3940,8 @@ static sector_t reshape_request(mddev_t *mddev, sector_t sector_nr, int *skipped
3940 * then we need to write out the superblock. 3940 * then we need to write out the superblock.
3941 */ 3941 */
3942 sector_nr += reshape_sectors; 3942 sector_nr += reshape_sectors;
3943 if (sector_nr >= mddev->resync_max) { 3943 if ((sector_nr - mddev->curr_resync_completed) * 2
3944 >= mddev->resync_max - mddev->curr_resync_completed) {
3944 /* Cannot proceed until we've updated the superblock... */ 3945 /* Cannot proceed until we've updated the superblock... */
3945 wait_event(conf->wait_for_overlap, 3946 wait_event(conf->wait_for_overlap,
3946 atomic_read(&conf->reshape_stripes) == 0); 3947 atomic_read(&conf->reshape_stripes) == 0);