diff options
-rw-r--r-- | drivers/md/dm-snap-persistent.c | 46 |
1 files changed, 21 insertions, 25 deletions
diff --git a/drivers/md/dm-snap-persistent.c b/drivers/md/dm-snap-persistent.c index 0c746420c008..7e855fbeb22e 100644 --- a/drivers/md/dm-snap-persistent.c +++ b/drivers/md/dm-snap-persistent.c | |||
@@ -552,35 +552,31 @@ static int persistent_read_metadata(struct dm_exception_store *store, | |||
552 | ps->current_area = 0; | 552 | ps->current_area = 0; |
553 | zero_memory_area(ps); | 553 | zero_memory_area(ps); |
554 | r = zero_disk_area(ps, 0); | 554 | r = zero_disk_area(ps, 0); |
555 | if (r) { | 555 | if (r) |
556 | DMWARN("zero_disk_area(0) failed"); | 556 | DMWARN("zero_disk_area(0) failed"); |
557 | return r; | 557 | return r; |
558 | } | 558 | } |
559 | } else { | 559 | /* |
560 | /* | 560 | * Sanity checks. |
561 | * Sanity checks. | 561 | */ |
562 | */ | 562 | if (ps->version != SNAPSHOT_DISK_VERSION) { |
563 | if (ps->version != SNAPSHOT_DISK_VERSION) { | 563 | DMWARN("unable to handle snapshot disk version %d", |
564 | DMWARN("unable to handle snapshot disk version %d", | 564 | ps->version); |
565 | ps->version); | 565 | return -EINVAL; |
566 | return -EINVAL; | 566 | } |
567 | } | ||
568 | 567 | ||
569 | /* | 568 | /* |
570 | * Metadata are valid, but snapshot is invalidated | 569 | * Metadata are valid, but snapshot is invalidated |
571 | */ | 570 | */ |
572 | if (!ps->valid) | 571 | if (!ps->valid) |
573 | return 1; | 572 | return 1; |
574 | 573 | ||
575 | /* | 574 | /* |
576 | * Read the metadata. | 575 | * Read the metadata. |
577 | */ | 576 | */ |
578 | r = read_exceptions(ps, callback, callback_context); | 577 | r = read_exceptions(ps, callback, callback_context); |
579 | if (r) | ||
580 | return r; | ||
581 | } | ||
582 | 578 | ||
583 | return 0; | 579 | return r; |
584 | } | 580 | } |
585 | 581 | ||
586 | static int persistent_prepare_exception(struct dm_exception_store *store, | 582 | static int persistent_prepare_exception(struct dm_exception_store *store, |