aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/dm-exception-store.c
diff options
context:
space:
mode:
authorMilan Broz <mbroz@redhat.com>2007-07-12 12:28:13 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-12 18:01:08 -0400
commit0764147b111b8ca886e4f2e9c9e019106b09b657 (patch)
tree815c9d80c961d54c79692ebe4751318c9052ad45 /drivers/md/dm-exception-store.c
parentfcac03abd325e4f7a4cc8fe05fea2793b1c8eb75 (diff)
dm snapshot: permit invalid activation
Allow invalid snapshots to be activated instead of failing. This allows userspace to reinstate any given snapshot state - for example after an unscheduled reboot - and clean up the invalid snapshot at its leisure. Cc: stable@kernel.org Signed-off-by: Milan Broz <mbroz@redhat.com> Signed-off-by: Alasdair G Kergon <agk@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/md/dm-exception-store.c')
-rw-r--r--drivers/md/dm-exception-store.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/md/dm-exception-store.c b/drivers/md/dm-exception-store.c
index 8c25c2ff724a..3d65917a1bbb 100644
--- a/drivers/md/dm-exception-store.c
+++ b/drivers/md/dm-exception-store.c
@@ -489,11 +489,6 @@ static int persistent_read_metadata(struct exception_store *store)
489 /* 489 /*
490 * Sanity checks. 490 * Sanity checks.
491 */ 491 */
492 if (!ps->valid) {
493 DMWARN("snapshot is marked invalid");
494 return -EINVAL;
495 }
496
497 if (ps->version != SNAPSHOT_DISK_VERSION) { 492 if (ps->version != SNAPSHOT_DISK_VERSION) {
498 DMWARN("unable to handle snapshot disk version %d", 493 DMWARN("unable to handle snapshot disk version %d",
499 ps->version); 494 ps->version);
@@ -501,6 +496,12 @@ static int persistent_read_metadata(struct exception_store *store)
501 } 496 }
502 497
503 /* 498 /*
499 * Metadata are valid, but snapshot is invalidated
500 */
501 if (!ps->valid)
502 return 1;
503
504 /*
504 * Read the metadata. 505 * Read the metadata.
505 */ 506 */
506 r = read_exceptions(ps); 507 r = read_exceptions(ps);