X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fmd%2Fdm-exception-store.c;h=8fe81e1807e0cc9c7e35202990bc419274143335;hb=2ab82852a2706b47c257ac87675ab8b06bc214dd;hp=8c25c2ff724a9f3366fa00d4ad0fe2eb781d6fbd;hpb=fcac03abd325e4f7a4cc8fe05fea2793b1c8eb75;p=linux-2.6-omap-h63xx.git diff --git a/drivers/md/dm-exception-store.c b/drivers/md/dm-exception-store.c index 8c25c2ff724..8fe81e1807e 100644 --- a/drivers/md/dm-exception-store.c +++ b/drivers/md/dm-exception-store.c @@ -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; }