aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/dm-snap.c
diff options
context:
space:
mode:
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)
387 return (n + size) & ~size; 387 return (n + size) & ~size;
388} 388}
389 389
390static void read_snapshot_metadata(struct dm_snapshot *s)
391{
392 if (s->store.read_metadata(&s->store)) {
393 down_write(&s->lock);
394 s->valid = 0;
395 up_write(&s->lock);
396
397 dm_table_event(s->table);
398 }
399}
400
401static int set_chunk_size(struct dm_snapshot *s, const char *chunk_size_arg, 390static int set_chunk_size(struct dm_snapshot *s, const char *chunk_size_arg,
402 char **error) 391 char **error)
403{ 392{
@@ -528,7 +517,11 @@ static int snapshot_ctr(struct dm_target *ti, unsigned int argc, char **argv)
528 } 517 }
529 518
530 /* Metadata must only be loaded into one table at once */ 519 /* Metadata must only be loaded into one table at once */
531 read_snapshot_metadata(s); 520 r = s->store.read_metadata(&s->store);
521 if (r) {
522 ti->error = "Failed to read snapshot metadata";
523 goto bad6;
524 }
532 525
533 /* Add snapshot to the list of snapshots for this origin */ 526 /* Add snapshot to the list of snapshots for this origin */
534 /* Exceptions aren't triggered till snapshot_resume() is called */ 527 /* Exceptions aren't triggered till snapshot_resume() is called */