From: Kefu Chai Date: Mon, 11 May 2026 05:27:42 +0000 (+0800) Subject: crimson: abort on ioctl(BLKGETNRZONES) failure X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f9acf620bb20f313a4a4dbca6f22fe3306ffc0be;p=ceph.git crimson: abort on ioctl(BLKGETNRZONES) failure previously, we did not check the return value of ioctl(BLKGETNRZONES). we query the number of zones of the storage device to determine which seastore backend to use. the only possible error from this ioctl is -EFAULT (invalid user pointer), which indicates a programming error and should never happen in practice. use ceph_assert() to catch this. Signed-off-by: Kefu Chai --- diff --git a/src/crimson/os/seastore/segment_manager.cc b/src/crimson/os/seastore/segment_manager.cc index 1252cc385973..90a95be0a430 100644 --- a/src/crimson/os/seastore/segment_manager.cc +++ b/src/crimson/os/seastore/segment_manager.cc @@ -39,7 +39,8 @@ SegmentManager::get_segment_manager( seastar::open_flags::rw); ceph_assert(file); uint32_t nr_zones = 0; - [[maybe_unused]] auto ret = co_await file.ioctl(BLKGETNRZONES, &nr_zones); + 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");