aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/dm-raid1.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/md/dm-raid1.c')
-rw-r--r--drivers/md/dm-raid1.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/md/dm-raid1.c b/drivers/md/dm-raid1.c
index 762cb086bb7f..64489e714c95 100644
--- a/drivers/md/dm-raid1.c
+++ b/drivers/md/dm-raid1.c
@@ -405,24 +405,22 @@ static void rh_update_states(struct region_hash *rh)
405 write_lock_irq(&rh->hash_lock); 405 write_lock_irq(&rh->hash_lock);
406 spin_lock(&rh->region_lock); 406 spin_lock(&rh->region_lock);
407 if (!list_empty(&rh->clean_regions)) { 407 if (!list_empty(&rh->clean_regions)) {
408 list_splice(&rh->clean_regions, &clean); 408 list_splice_init(&rh->clean_regions, &clean);
409 INIT_LIST_HEAD(&rh->clean_regions);
410 409
411 list_for_each_entry(reg, &clean, list) 410 list_for_each_entry(reg, &clean, list)
412 list_del(&reg->hash_list); 411 list_del(&reg->hash_list);
413 } 412 }
414 413
415 if (!list_empty(&rh->recovered_regions)) { 414 if (!list_empty(&rh->recovered_regions)) {
416 list_splice(&rh->recovered_regions, &recovered); 415 list_splice_init(&rh->recovered_regions, &recovered);
417 INIT_LIST_HEAD(&rh->recovered_regions);
418 416
419 list_for_each_entry (reg, &recovered, list) 417 list_for_each_entry (reg, &recovered, list)
420 list_del(&reg->hash_list); 418 list_del(&reg->hash_list);
421 } 419 }
422 420
423 if (!list_empty(&rh->failed_recovered_regions)) { 421 if (!list_empty(&rh->failed_recovered_regions)) {
424 list_splice(&rh->failed_recovered_regions, &failed_recovered); 422 list_splice_init(&rh->failed_recovered_regions,
425 INIT_LIST_HEAD(&rh->failed_recovered_regions); 423 &failed_recovered);
426 424
427 list_for_each_entry(reg, &failed_recovered, list) 425 list_for_each_entry(reg, &failed_recovered, list)
428 list_del(&reg->hash_list); 426 list_del(&reg->hash_list);