Skip to content

Commit 86627f8

Browse files
committed
crimson/os/seastore: ensure the block size of device is always greater than laddr_t::UNIT_SIZE
Signed-off-by: Zhang Song <[email protected]>
1 parent 9050368 commit 86627f8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/crimson/os/seastore/seastore.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,8 @@ SeaStore::mount_ertr::future<> SeaStore::mount()
253253
ceph_assert(seastar::this_shard_id() == primary_core);
254254
return device->mount(
255255
).safe_then([this] {
256+
ceph_assert(device->get_sharded_device().get_block_size()
257+
>= laddr_t::UNIT_SIZE);
256258
auto &sec_devices = device->get_sharded_device().get_secondary_devices();
257259
return crimson::do_for_each(sec_devices, [this](auto& device_entry) {
258260
device_id_t id = device_entry.first;
@@ -266,6 +268,8 @@ SeaStore::mount_ertr::future<> SeaStore::mount()
266268
).then([this, magic, sec_dev = std::move(sec_dev)]() mutable {
267269
return sec_dev->mount(
268270
).safe_then([this, sec_dev=std::move(sec_dev), magic]() mutable {
271+
ceph_assert(sec_dev->get_sharded_device().get_block_size()
272+
>= laddr_t::UNIT_SIZE);
269273
boost::ignore_unused(magic); // avoid clang warning;
270274
assert(sec_dev->get_sharded_device().get_magic() == magic);
271275
secondaries.emplace_back(std::move(sec_dev));

0 commit comments

Comments
 (0)