summaryrefslogtreecommitdiffstats
path: root/drivers/md/dm-snap.c
diff options
context:
space:
mode:
authorMark McLoughlin <markmc@redhat.com>2006-10-03 01:15:25 -0700
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-03 08:04:14 -0700
commitf9cea4f70734f743e0beb55552a9794fa5032645 (patch)
tree7227221bc8913aedfa0f222c365137f549125efc /drivers/md/dm-snap.c
parent4c7e3bf44d0ae227ea1ee87c2197212e65d043d7 (diff)
downloadlinux-f9cea4f70734f743e0beb55552a9794fa5032645.tar.bz2
[PATCH] dm snapshot: fix metadata error handling
Fix the error handling when store.read_metadata is called: the error should be returned immediately. Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Alasdair G Kergon <agk@redhat.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/md/dm-snap.c')
-rw-r--r--drivers/md/dm-snap.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/drivers/md/dm-snap.c b/drivers/md/dm-snap.c
index 89f8dd1bfaa0..58c444fb189c 100644
--- a/drivers/md/dm-snap.c
+++ b/drivers/md/dm-snap.c
@@ -387,17 +387,6 @@ static inline ulong round_up(ulong n, ulong size)
return (n + size) & ~size;
}
-static void read_snapshot_metadata(struct dm_snapshot *s)
-{
- if (s->store.read_metadata(&s->store)) {
- down_write(&s->lock);
- s->valid = 0;
- up_write(&s->lock);
-
- dm_table_event(s->table);
- }
-}
-
static int set_chunk_size(struct dm_snapshot *s, const char *chunk_size_arg,
char **error)
{
@@ -528,7 +517,11 @@ static int snapshot_ctr(struct dm_target *ti, unsigned int argc, char **argv)
}
/* Metadata must only be loaded into one table at once */
- read_snapshot_metadata(s);
+ r = s->store.read_metadata(&s->store);
+ if (r) {
+ ti->error = "Failed to read snapshot metadata";
+ goto bad6;
+ }
/* Add snapshot to the list of snapshots for this origin */
/* Exceptions aren't triggered till snapshot_resume() is called */