Skip to content

Commit

Permalink
io_uring: honour zeroes as io-wq worker limits
Browse files Browse the repository at this point in the history
When we pass in zero as an io-wq worker number limit it shouldn't
actually change the limits but return the old value, follow that
behaviour with deferred limits setup as well.

Cc: [email protected] # 5.15
Reported-by: Beld Zhang <[email protected]>
Fixes: e139a1e ("io_uring: apply max_workers limit to all future users")
Signed-off-by: Pavel Begunkov <[email protected]>
Link: https://lore.kernel.org/r/1b222a92f7a78a24b042763805e891a4cdd4b544.1636384034.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
isilence authored and axboe committed Nov 8, 2021
1 parent a195778 commit bad119b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion fs/io_uring.c
Original file line number Diff line number Diff line change
Expand Up @@ -10791,7 +10791,9 @@ static __cold int io_register_iowq_max_workers(struct io_ring_ctx *ctx,

BUILD_BUG_ON(sizeof(new_count) != sizeof(ctx->iowq_limits));

memcpy(ctx->iowq_limits, new_count, sizeof(new_count));
for (i = 0; i < ARRAY_SIZE(new_count); i++)
if (new_count[i])
ctx->iowq_limits[i] = new_count[i];
ctx->iowq_limits_set = true;

if (tctx && tctx->io_wq) {
Expand Down

0 comments on commit bad119b

Please sign in to comment.