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 <k.chai@proxmox.com>
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<segment_manager::zbd::ZBDSegmentManager>(device + "/block");