aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/md/dm-raid1.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/md/dm-raid1.c b/drivers/md/dm-raid1.c
index b3bba98af772..04dce7a66494 100644
--- a/drivers/md/dm-raid1.c
+++ b/drivers/md/dm-raid1.c
@@ -378,10 +378,8 @@ static void rh_update_states(struct region_hash *rh)
378 list_splice(&rh->clean_regions, &clean); 378 list_splice(&rh->clean_regions, &clean);
379 INIT_LIST_HEAD(&rh->clean_regions); 379 INIT_LIST_HEAD(&rh->clean_regions);
380 380
381 list_for_each_entry (reg, &clean, list) { 381 list_for_each_entry(reg, &clean, list)
382 rh->log->type->clear_region(rh->log, reg->key);
383 list_del(&reg->hash_list); 382 list_del(&reg->hash_list);
384 }
385 } 383 }
386 384
387 if (!list_empty(&rh->recovered_regions)) { 385 if (!list_empty(&rh->recovered_regions)) {
@@ -405,10 +403,12 @@ static void rh_update_states(struct region_hash *rh)
405 mempool_free(reg, rh->region_pool); 403 mempool_free(reg, rh->region_pool);
406 } 404 }
407 405
408 rh->log->type->flush(rh->log); 406 list_for_each_entry_safe(reg, next, &clean, list) {
409 407 rh->log->type->clear_region(rh->log, reg->key);
410 list_for_each_entry_safe (reg, next, &clean, list)
411 mempool_free(reg, rh->region_pool); 408 mempool_free(reg, rh->region_pool);
409 }
410
411 rh->log->type->flush(rh->log);
412} 412}
413 413
414static void rh_inc(struct region_hash *rh, region_t region) 414static void rh_inc(struct region_hash *rh, region_t region)