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.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/drivers/md/dm-raid1.c b/drivers/md/dm-raid1.c
index 4e90f231fbfb..3d90f1b37e08 100644
--- a/drivers/md/dm-raid1.c
+++ b/drivers/md/dm-raid1.c
@@ -402,9 +402,21 @@ static void rh_dec(struct region_hash *rh, region_t region)
402 402
403 spin_lock_irqsave(&rh->region_lock, flags); 403 spin_lock_irqsave(&rh->region_lock, flags);
404 if (atomic_dec_and_test(&reg->pending)) { 404 if (atomic_dec_and_test(&reg->pending)) {
405 /*
406 * There is no pending I/O for this region.
407 * We can move the region to corresponding list for next action.
408 * At this point, the region is not yet connected to any list.
409 *
410 * If the state is RH_NOSYNC, the region should be kept off
411 * from clean list.
412 * The hash entry for RH_NOSYNC will remain in memory
413 * until the region is recovered or the map is reloaded.
414 */
415
416 /* do nothing for RH_NOSYNC */
405 if (reg->state == RH_RECOVERING) { 417 if (reg->state == RH_RECOVERING) {
406 list_add_tail(&reg->list, &rh->quiesced_regions); 418 list_add_tail(&reg->list, &rh->quiesced_regions);
407 } else { 419 } else if (reg->state == RH_DIRTY) {
408 reg->state = RH_CLEAN; 420 reg->state = RH_CLEAN;
409 list_add(&reg->list, &rh->clean_regions); 421 list_add(&reg->list, &rh->clean_regions);
410 } 422 }