Skip to content

Commit bad119b

Browse files
isilenceaxboe
authored andcommitted
io_uring: honour zeroes as io-wq worker limits
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]>
1 parent a195778 commit bad119b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

fs/io_uring.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10791,7 +10791,9 @@ static __cold int io_register_iowq_max_workers(struct io_ring_ctx *ctx,
1079110791

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

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

1079710799
if (tctx && tctx->io_wq) {

0 commit comments

Comments
 (0)