diff options
-rw-r--r-- | drivers/md/dm-log.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/md/dm-log.c b/drivers/md/dm-log.c index a76349cb10a5..efe4adf78530 100644 --- a/drivers/md/dm-log.c +++ b/drivers/md/dm-log.c | |||
@@ -573,7 +573,7 @@ static int core_get_resync_work(struct dirty_log *log, region_t *region) | |||
573 | lc->sync_search); | 573 | lc->sync_search); |
574 | lc->sync_search = *region + 1; | 574 | lc->sync_search = *region + 1; |
575 | 575 | ||
576 | if (*region == lc->region_count) | 576 | if (*region >= lc->region_count) |
577 | return 0; | 577 | return 0; |
578 | 578 | ||
579 | } while (log_test_bit(lc->recovering_bits, *region)); | 579 | } while (log_test_bit(lc->recovering_bits, *region)); |