For older kernels without IORING_SETUP_CQSIZE, we'll get EINVAL if we
set it. Just retry the ring setup if that happens.
Link: https://github.com/axboe/fio/issues/1324
Signed-off-by: Jens Axboe <axboe@kernel.dk>
p.flags |= IORING_SETUP_CQSIZE;
p.cq_entries = depth;
+retry:
ret = syscall(__NR_io_uring_setup, depth, &p);
- if (ret < 0)
+ if (ret < 0) {
+ if (errno == EINVAL && p.flags & IORING_SETUP_CQSIZE) {
+ p.flags &= ~IORING_SETUP_CQSIZE;
+ goto retry;
+ }
return ret;
+ }
ld->ring_fd = ret;