io_uring: ensure IORING_REGISTER_IOWQ_MAX_WORKERS works with SQPOLL
authorJens Axboe <axboe@kernel.dk>
Wed, 1 Sep 2021 20:15:59 +0000 (14:15 -0600)
committerJens Axboe <axboe@kernel.dk>
Fri, 3 Sep 2021 12:16:11 +0000 (06:16 -0600)
commitfa84693b3c896460831fe0750554121121a23da8
tree5fe8b342f8c256587f47e3de11ebb4c89b9e78b0
parent3146cba99aa284b1d4a10fbd923df953f1d18035
io_uring: ensure IORING_REGISTER_IOWQ_MAX_WORKERS works with SQPOLL

SQPOLL has a different thread doing submissions, we need to check for
that and use the right task context when updating the worker values.
Just hold the sqd->lock across the operation, this ensures that the
thread cannot go away while we poke at ->io_uring.

Link: https://github.com/axboe/liburing/issues/420
Fixes: 2e480058ddc2 ("io-wq: provide a way to limit max number of workers")
Reported-by: Johannes Lundberg <johalun0@gmail.com>
Tested-by: Johannes Lundberg <johalun0@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c