diff --git a/[refs] b/[refs] index 9690c739c879..57d4cccb210a 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 7c9e6c17325fab380fbe9c9787680ff7d4a51abd +refs/heads/master: 7acedc5b98a2fcff64f00c21110aae7d3ac2f7df diff --git a/trunk/drivers/md/dm-exception-store.c b/trunk/drivers/md/dm-exception-store.c index fe6cef8df203..6179bf70f98a 100644 --- a/trunk/drivers/md/dm-exception-store.c +++ b/trunk/drivers/md/dm-exception-store.c @@ -610,18 +610,23 @@ static void persistent_commit(struct exception_store *store, (ps->current_committed != ps->exceptions_per_area)) return; + /* + * If we completely filled the current area, then wipe the next one. + */ + if ((ps->current_committed == ps->exceptions_per_area) && + zero_disk_area(ps, ps->current_area + 1)) + ps->valid = 0; + /* * Commit exceptions to disk. */ - if (area_io(ps, WRITE)) + if (ps->valid && area_io(ps, WRITE)) ps->valid = 0; /* * Advance to the next area if this one is full. */ if (ps->current_committed == ps->exceptions_per_area) { - if (zero_disk_area(ps, ps->current_area + 1)) - ps->valid = 0; ps->current_committed = 0; ps->current_area++; zero_memory_area(ps);