crimson/seastore: clamp block_size to laddr_t::UNIT_SIZE on small-LBA devices
Seastar's file::disk_write_dma_alignment() faithfully reports what the kernel exposes for the underlying device. On block devices in 512-byte LBA mode (the factory default for many NVMe SSDs), it correctly returns 512. SeaStore's internal addressing, however, operates at a 4 KiB page granularity defined by laddr_t::UNIT_SIZE, and SeaStore::_mount() asserts that block_size >= UNIT_SIZE. As a result, ceph-osd-crimson --mkfs --osd-objectstore seastore aborts on any device shipped in 512-LBA mode: seastore.cc:344 ceph_assert(block_size >= laddr_t::UNIT_SIZE) seastore requires a device block size of at least 4096 bytes, but the primary device at '/var/lib/ceph/osd/ceph-N/block' reports block_size=512 The reported alignment is not wrong; it is the minimum Linux enforces for O_DIRECT on that device, so users with optimization in mind can override it through io_properties.yaml. But SeaStore can run correctly on 512-LBA devices as long as it issues only 4 KiB-aligned I/O (which is also 512-aligned, so the device is happy). Clamp the captured block_size to laddr_t::UNIT_SIZE so SeaStore can host an OSD on 512-LBA storage without operator intervention, while still honoring larger device-reported alignments when present. Signed-off-by: Kefu Chai <k.chai@proxmox.com>
K
Kefu Chai committed
a47da78c0dcd18dbe3ae67f8030d43f46aa5b7cd
Parent: 4d15f1c