]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/os/seastore: ensure the block size of device is always greater than laddr_t... 59182/head
authorZhang Song <zhangsong02@qianxin.com>
Thu, 22 Aug 2024 10:56:51 +0000 (18:56 +0800)
committerZhang Song <zhangsong02@qianxin.com>
Tue, 27 Aug 2024 06:22:52 +0000 (14:22 +0800)
Signed-off-by: Zhang Song <zhangsong02@qianxin.com>
src/crimson/os/seastore/seastore.cc

index 9c06c2d949ae2aabb5d501eb0fa81d4f65698232..2ac74aead444ebd1d72da53cf336c72097ed0110 100644 (file)
@@ -253,6 +253,8 @@ SeaStore::mount_ertr::future<> SeaStore::mount()
   ceph_assert(seastar::this_shard_id() == primary_core);
   return device->mount(
   ).safe_then([this] {
+    ceph_assert(device->get_sharded_device().get_block_size()
+               >= laddr_t::UNIT_SIZE);
     auto &sec_devices = device->get_sharded_device().get_secondary_devices();
     return crimson::do_for_each(sec_devices, [this](auto& device_entry) {
       device_id_t id = device_entry.first;
@@ -266,6 +268,8 @@ SeaStore::mount_ertr::future<> SeaStore::mount()
         ).then([this, magic, sec_dev = std::move(sec_dev)]() mutable {
           return sec_dev->mount(
           ).safe_then([this, sec_dev=std::move(sec_dev), magic]() mutable {
+           ceph_assert(sec_dev->get_sharded_device().get_block_size()
+                       >= laddr_t::UNIT_SIZE);
             boost::ignore_unused(magic);  // avoid clang warning;
             assert(sec_dev->get_sharded_device().get_magic() == magic);
             secondaries.emplace_back(std::move(sec_dev));