From 09ce099c2f184924e1b9be0617d4a9ce6de4481c Mon Sep 17 00:00:00 2001 From: Joe Thornber Date: Wed, 17 Feb 2016 10:42:42 +0000 Subject: [PATCH] [thin_delta] set nr_data_blocks to zero if there are no space maps. ie. a metadata_snap is being used. --- thin-provisioning/thin_delta.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/thin-provisioning/thin_delta.cc b/thin-provisioning/thin_delta.cc index 3ec71c8..3b33c73 100644 --- a/thin-provisioning/thin_delta.cc +++ b/thin-provisioning/thin_delta.cc @@ -527,7 +527,7 @@ namespace local { mapping_recorder mr2; damage_visitor damage_v; superblock_detail::superblock sb; - checked_space_map::ptr data_sm; + block_address nr_data_blocks = 0ull; { block_manager<>::ptr bm = open_bm(*fs.dev, block_manager<>::READ_ONLY, !fs.use_metadata_snap); @@ -562,13 +562,16 @@ namespace local { btree_visit_values(snap2, mr2, damage_v); mr2.complete(); + + if (md->data_sm_) + nr_data_blocks = md->data_sm_->get_nr_blocks(); } indented_stream is(cout); begin_superblock(is, "", sb.time_, sb.trans_id_, sb.data_block_size_, - data_sm->get_nr_blocks(), + nr_data_blocks, sb.metadata_snap_ ? boost::optional(sb.metadata_snap_) : boost::optional());