thin_dump.cc: fix metadata snapshot logic

This commit is contained in:
Heinz Mauelshagen 2013-07-30 15:31:36 +02:00
parent 38bab662b6
commit 78389803bc

View File

@ -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")