diff options
-rw-r--r-- | drivers/md/md.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c index 1be7a16a7a53..a08aa582925b 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c | |||
@@ -6524,11 +6524,15 @@ void md_do_sync(mddev_t *mddev) | |||
6524 | set_bit(MD_CHANGE_DEVS, &mddev->flags); | 6524 | set_bit(MD_CHANGE_DEVS, &mddev->flags); |
6525 | 6525 | ||
6526 | skip: | 6526 | skip: |
6527 | if (!test_bit(MD_RECOVERY_INTR, &mddev->recovery)) { | ||
6528 | /* We completed so min/max setting can be forgotten if used. */ | ||
6529 | if (test_bit(MD_RECOVERY_REQUESTED, &mddev->recovery)) | ||
6530 | mddev->resync_min = 0; | ||
6531 | mddev->resync_max = MaxSector; | ||
6532 | } else if (test_bit(MD_RECOVERY_REQUESTED, &mddev->recovery)) | ||
6533 | mddev->resync_min = mddev->curr_resync_completed; | ||
6527 | mddev->curr_resync = 0; | 6534 | mddev->curr_resync = 0; |
6528 | mddev->curr_resync_completed = 0; | 6535 | mddev->curr_resync_completed = 0; |
6529 | if (!test_bit(MD_RECOVERY_INTR, &mddev->recovery)) | ||
6530 | /* We completed so max setting can be forgotten. */ | ||
6531 | mddev->resync_max = MaxSector; | ||
6532 | sysfs_notify(&mddev->kobj, NULL, "sync_completed"); | 6536 | sysfs_notify(&mddev->kobj, NULL, "sync_completed"); |
6533 | wake_up(&resync_wait); | 6537 | wake_up(&resync_wait); |
6534 | set_bit(MD_RECOVERY_DONE, &mddev->recovery); | 6538 | set_bit(MD_RECOVERY_DONE, &mddev->recovery); |