From c8c4442b2f85d756154854275122ab7c28d30ae7 Mon Sep 17 00:00:00 2001 From: Joe Thornber Date: Wed, 10 Feb 2016 13:34:07 +0000 Subject: [PATCH] [thin_dump] We can't give the number of data blocks with a metadata snap. No space maps. --- thin-provisioning/metadata_dumper.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/thin-provisioning/metadata_dumper.cc b/thin-provisioning/metadata_dumper.cc index 52199f2..0c0fbe4 100644 --- a/thin-provisioning/metadata_dumper.cc +++ b/thin-provisioning/metadata_dumper.cc @@ -222,10 +222,14 @@ thin_provisioning::metadata_dump(metadata::ptr md, emitter::ptr e, bool repair) device_tree_detail::damage_visitor::ptr dd_policy(details_damage_policy(repair)); walk_device_tree(*md->details_, de, *dd_policy); + // metadata snap doesn't have the space maps so we don't know how + // many data blocks there are. + block_address nr_data_blocks = md->data_sm_ ? md->data_sm_->get_nr_blocks() : 0; + e->begin_superblock("", md->sb_.time_, md->sb_.trans_id_, md->sb_.data_block_size_, - md->data_sm_->get_nr_blocks(), + nr_data_blocks, boost::optional()); {