Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
io_uring: round-up cq size before comparing with rounded sq size
If an application specifies IORING_SETUP_CQSIZE to set the CQ ring size to a specific size, we ensure that the CQ size is at least that of the SQ ring size. But in doing so, we compare the already rounded up to power of two SQ size to the as-of yet unrounded CQ size. This means that if an application passes in non power of two sizes, we can return -EINVAL when the final value would've been fine. As an example, an application passing in 100/100 for sq/cq size should end up with 128 for both. But since we round the SQ size first, we compare the CQ size of 100 to 128, and return -EINVAL as that is too small. Cc: [email protected] Fixes: 33a107f ("io_uring: allow application controlled CQ ring size") Reported-by: Dan Melnic <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
- Loading branch information