From 1433d11f59ea861a6002ebfd7ab766c3ac1465c7 Mon Sep 17 00:00:00 2001 From: Joe Thornber Date: Tue, 17 Apr 2018 13:32:49 +0100 Subject: [PATCH] [thin-provisioning/metadata] Use latest metadata version (2) --- thin-provisioning/metadata.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/thin-provisioning/metadata.cc b/thin-provisioning/metadata.cc index 08dd666..a39251d 100644 --- a/thin-provisioning/metadata.cc +++ b/thin-provisioning/metadata.cc @@ -33,6 +33,8 @@ using namespace base; using namespace thin_provisioning; +#define METADATA_VERSION 2 + //---------------------------------------------------------------- namespace { @@ -59,7 +61,7 @@ metadata::metadata(block_manager<>::ptr bm, open_type ot, tm_ = open_tm(bm, SUPERBLOCK_LOCATION); sb_ = read_superblock(tm_->get_bm()); - if (sb_.version_ != 1) + if (sb_.version_ < METADATA_VERSION) throw runtime_error("unknown metadata version"); metadata_sm_ = open_metadata_sm(*tm_, &sb_.metadata_space_map_root_); @@ -91,7 +93,7 @@ metadata::metadata(block_manager<>::ptr bm, open_type ot, ::memset(&sb_, 0, sizeof(sb_)); sb_.magic_ = SUPERBLOCK_MAGIC; - sb_.version_ = 1; + sb_.version_ = METADATA_VERSION; sb_.data_mapping_root_ = mappings_->get_root(); sb_.device_details_root_ = details_->get_root(); sb_.data_block_size_ = data_block_size;