From 78389803bc8df3c466de603fa7f17ee9bb69f2b2 Mon Sep 17 00:00:00 2001 From: Heinz Mauelshagen Date: Tue, 30 Jul 2013 15:31:36 +0200 Subject: [PATCH] thin_dump.cc: fix metadata snapshot logic --- thin-provisioning/thin_dump.cc | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/thin-provisioning/thin_dump.cc b/thin-provisioning/thin_dump.cc index c6c01ea..944b7ae 100644 --- a/thin-provisioning/thin_dump.cc +++ b/thin-provisioning/thin_dump.cc @@ -44,12 +44,14 @@ namespace { emitter::ptr e; uint64_t metadata_snap_root = md->sb_.metadata_snap_; /* FIXME: use thin_pool method? */ - if (metadata_snap_root) { - md.reset(); - md = metadata::ptr(new metadata(path, metadata_snap_root)); - } else if (flags.find_metadata_snap) { - cerr << "no metadata snapshot found!" << endl; - exit(1); + if (flags.find_metadata_snap) { + if (metadata_snap_root) { + md.reset(); + md = metadata::ptr(new metadata(path, metadata_snap_root)); + } else { + cerr << "no metadata snapshot found!" << endl; + exit(1); + } } if (format == "xml")