Merge tag 'io_uring-5.10-2020-11-13' of git://git.kernel.dk/linux-block
Pull io_uring fix from Jens Axboe: "A single fix in here, for a missed rounding case at setup time, which caused an otherwise legitimate setup case to return -EINVAL if used with unaligned ring size values" * tag 'io_uring-5.10-2020-11-13' of git://git.kernel.dk/linux-block: io_uring: round-up cq size before comparing with rounded sq size
This commit is contained in:
+1
-1
@@ -9226,6 +9226,7 @@ static int io_uring_create(unsigned entries, struct io_uring_params *p,
|
||||
* to a power-of-two, if it isn't already. We do NOT impose
|
||||
* any cq vs sq ring sizing.
|
||||
*/
|
||||
p->cq_entries = roundup_pow_of_two(p->cq_entries);
|
||||
if (p->cq_entries < p->sq_entries)
|
||||
return -EINVAL;
|
||||
if (p->cq_entries > IORING_MAX_CQ_ENTRIES) {
|
||||
@@ -9233,7 +9234,6 @@ static int io_uring_create(unsigned entries, struct io_uring_params *p,
|
||||
return -EINVAL;
|
||||
p->cq_entries = IORING_MAX_CQ_ENTRIES;
|
||||
}
|
||||
p->cq_entries = roundup_pow_of_two(p->cq_entries);
|
||||
} else {
|
||||
p->cq_entries = 2 * p->sq_entries;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user