summaryrefslogtreecommitdiffstats
path: root/src/crimson/os/seastore/segment_manager
diff options
context:
space:
mode:
Diffstat (limited to 'src/crimson/os/seastore/segment_manager')
-rw-r--r--src/crimson/os/seastore/segment_manager/block.cc1
-rw-r--r--src/crimson/os/seastore/segment_manager/block.h8
2 files changed, 7 insertions, 2 deletions
diff --git a/src/crimson/os/seastore/segment_manager/block.cc b/src/crimson/os/seastore/segment_manager/block.cc
index d0c34f36d82..04b83b56c5f 100644
--- a/src/crimson/os/seastore/segment_manager/block.cc
+++ b/src/crimson/os/seastore/segment_manager/block.cc
@@ -516,6 +516,7 @@ BlockSegmentManager::mkfs_ret BlockSegmentManager::mkfs(
device_config_t sm_config)
{
LOG_PREFIX(BlockSegmentManager::mkfs);
+ ceph_assert(sm_config.spec.dtype == superblock.config.spec.dtype);
set_device_id(sm_config.spec.id);
INFO("{} path={}, {}",
device_id_printer_t{get_device_id()}, device_path, sm_config);
diff --git a/src/crimson/os/seastore/segment_manager/block.h b/src/crimson/os/seastore/segment_manager/block.h
index 03662d5521e..4fa715ba71f 100644
--- a/src/crimson/os/seastore/segment_manager/block.h
+++ b/src/crimson/os/seastore/segment_manager/block.h
@@ -118,8 +118,12 @@ public:
close_ertr::future<> close();
BlockSegmentManager(
- const std::string &path)
- : device_path(path) {}
+ const std::string &path,
+ device_type_t dtype)
+ : device_path(path) {
+ ceph_assert(get_device_type() == device_type_t::NONE);
+ superblock.config.spec.dtype = dtype;
+ }
~BlockSegmentManager();