]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/md/dm-exception-store.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6
[linux-2.6-omap-h63xx.git] / drivers / md / dm-exception-store.c
index fe6cef8df203aa697ef3bf82e68cd2cacd1cc818..01590f3e00093ffd25e9fe0aa6e70d1472e607f4 100644 (file)
@@ -7,7 +7,6 @@
  * This file is released under the GPL.
  */
 
-#include "dm.h"
 #include "dm-snap.h"
 
 #include <linux/mm.h>
@@ -610,18 +609,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);