aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/md/dm-exception-store.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/md/dm-exception-store.c b/drivers/md/dm-exception-store.c
index fe6cef8df203..6179bf70f98a 100644
--- a/drivers/md/dm-exception-store.c
+++ b/drivers/md/dm-exception-store.c
@@ -611,17 +611,22 @@ static void persistent_commit(struct exception_store *store,
611 return; 611 return;
612 612
613 /* 613 /*
614 * If we completely filled the current area, then wipe the next one.
615 */
616 if ((ps->current_committed == ps->exceptions_per_area) &&
617 zero_disk_area(ps, ps->current_area + 1))
618 ps->valid = 0;
619
620 /*
614 * Commit exceptions to disk. 621 * Commit exceptions to disk.
615 */ 622 */
616 if (area_io(ps, WRITE)) 623 if (ps->valid && area_io(ps, WRITE))
617 ps->valid = 0; 624 ps->valid = 0;
618 625
619 /* 626 /*
620 * Advance to the next area if this one is full. 627 * Advance to the next area if this one is full.
621 */ 628 */
622 if (ps->current_committed == ps->exceptions_per_area) { 629 if (ps->current_committed == ps->exceptions_per_area) {
623 if (zero_disk_area(ps, ps->current_area + 1))
624 ps->valid = 0;
625 ps->current_committed = 0; 630 ps->current_committed = 0;
626 ps->current_area++; 631 ps->current_area++;
627 zero_memory_area(ps); 632 zero_memory_area(ps);