]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/md/dm-log.c
[MTD] JEDEC probe: kill some inline bloat
[linux-2.6-omap-h63xx.git] / drivers / md / dm-log.c
index a60acf8d385a3541123ff514e9c7902aa2456ce2..072ee4353eab329620995aceee14b468a49584a4 100644 (file)
@@ -478,7 +478,14 @@ static int disk_resume(struct dirty_log *log)
                DMWARN("%s: Failed to read header on mirror log device",
                       lc->log_dev->name);
                fail_log_device(lc);
-               return r;
+               /*
+                * If the log device cannot be read, we must assume
+                * all regions are out-of-sync.  If we simply return
+                * here, the state will be uninitialized and could
+                * lead us to return 'in-sync' status for regions
+                * that are actually 'out-of-sync'.
+                */
+               lc->header.nr_regions = 0;
        }
 
        /* set or clear any new bits -- device has grown */
@@ -689,7 +696,7 @@ static struct dirty_log_type _disk_type = {
        .module = THIS_MODULE,
        .ctr = disk_ctr,
        .dtr = disk_dtr,
-       .suspend = disk_flush,
+       .postsuspend = disk_flush,
        .resume = disk_resume,
        .get_region_size = core_get_region_size,
        .is_clean = core_is_clean,