From: Ronen Friedman Date: Mon, 13 Apr 2026 15:17:26 +0000 (+0000) Subject: crimson/os/seastore: use configured device type to select segment manager X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=7f739adae214bb6d8c7d1ed2fe71f83a2ba5a089;p=ceph.git crimson/os/seastore: use configured device type to select segment manager In get_segment_manager(), trust the user-specified device type rather than probing the device for ZNS zones. This simplifies the device type selection. More important: the change avoids opening a block file which was not yet created by the mkfs (we start() seastore then call mkfs. but starting seastore requires creating the right segment manager. And, currently, we probe the not-yet-created block file in mkfs() when trying to create it.) Signed-off-by: Ronen Friedman Co-authored-by: Kefu Chai --- diff --git a/src/crimson/os/seastore/segment_manager.cc b/src/crimson/os/seastore/segment_manager.cc index 0672b84a1374..501137a5835a 100644 --- a/src/crimson/os/seastore/segment_manager.cc +++ b/src/crimson/os/seastore/segment_manager.cc @@ -30,23 +30,18 @@ std::ostream& operator<<(std::ostream &out, Segment::segment_state_t s) seastar::future SegmentManager::get_segment_manager( - const std::string &device, device_type_t dtype) + const std::string& device, + device_type_t dtype) { + const std::string device_block = device + "/block"; #ifdef HAVE_ZNS LOG_PREFIX(SegmentManager::get_segment_manager); - auto file = co_await seastar::open_file_dma( - device + "/block", - seastar::open_flags::rw); - ceph_assert(file); - uint32_t nr_zones = 0; - auto ret = co_await file.ioctl(BLKGETNRZONES, &nr_zones); - ceph_assert(ret == 0); - INFO("Found {} zones.", nr_zones); - if (nr_zones != 0) { - co_return std::make_unique(device + "/block"); + if (dtype == device_type_t::ZBD) { + co_return std::make_unique( + device_block); } #endif - co_return std::make_unique(device + "/block", dtype); + co_return std::make_unique( + device_block, dtype); } - } // namespace crimson::os::seastore