]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/md/dm-exception-store.c
net/bonding: Enable bonding to enslave netdevices not supporting set_mac_address()
[linux-2.6-omap-h63xx.git] / drivers / md / dm-exception-store.c
index 8c25c2ff724a9f3366fa00d4ad0fe2eb781d6fbd..8fe81e1807e0cc9c7e35202990bc419274143335 100644 (file)
@@ -489,17 +489,18 @@ static int persistent_read_metadata(struct exception_store *store)
                /*
                 * Sanity checks.
                 */
-               if (!ps->valid) {
-                       DMWARN("snapshot is marked invalid");
-                       return -EINVAL;
-               }
-
                if (ps->version != SNAPSHOT_DISK_VERSION) {
                        DMWARN("unable to handle snapshot disk version %d",
                               ps->version);
                        return -EINVAL;
                }
 
+               /*
+                * Metadata are valid, but snapshot is invalidated
+                */
+               if (!ps->valid)
+                       return 1;
+
                /*
                 * Read the metadata.
                 */
@@ -622,6 +623,7 @@ int dm_create_persistent(struct exception_store *store)
 
        ps->metadata_wq = create_singlethread_workqueue("ksnaphd");
        if (!ps->metadata_wq) {
+               kfree(ps);
                DMERR("couldn't start header metadata update thread");
                return -ENOMEM;
        }