Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 59284
b: refs/heads/master
c: 0764147
h: refs/heads/master
v: v3
  • Loading branch information
Milan Broz authored and Linus Torvalds committed Jul 12, 2007
1 parent 189fb1d commit 2dc75ed
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: fcac03abd325e4f7a4cc8fe05fea2793b1c8eb75
refs/heads/master: 0764147b111b8ca886e4f2e9c9e019106b09b657
11 changes: 6 additions & 5 deletions trunk/drivers/md/dm-exception-store.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down
5 changes: 4 additions & 1 deletion trunk/drivers/md/dm-snap.c
Original file line number Diff line number Diff line change
Expand Up @@ -523,9 +523,12 @@ static int snapshot_ctr(struct dm_target *ti, unsigned int argc, char **argv)

/* Metadata must only be loaded into one table at once */
r = s->store.read_metadata(&s->store);
if (r) {
if (r < 0) {
ti->error = "Failed to read snapshot metadata";
goto bad6;
} else if (r > 0) {
s->valid = 0;
DMWARN("Snapshot is marked invalid.");
}

bio_list_init(&s->queued_bios);
Expand Down

0 comments on commit 2dc75ed

Please sign in to comment.