summaryrefslogtreecommitdiff
path: root/fs/io_uring.c
diff options
context:
space:
mode:
authorPavel Begunkov <asml.silence@gmail.com>2021-01-19 13:32:36 +0000
committerJens Axboe <axboe@kernel.dk>2021-02-01 10:02:42 -0700
commit5c766a908d06e96d30e0ec2511a24fa311553d2c (patch)
tree6654b2ffb8127857e1df30a751333fcd8f9e3772 /fs/io_uring.c
parentdc2a6e9aa9c349d76c318d22bbe26006fda1ce97 (diff)
downloadlwn-5c766a908d06e96d30e0ec2511a24fa311553d2c.tar.gz
lwn-5c766a908d06e96d30e0ec2511a24fa311553d2c.zip
io_uring: cleanup personalities under uring_lock
personality_idr is usually synchronised by uring_lock, the exception would be removing personalities in io_ring_ctx_wait_and_kill(), which is legit as refs are killed by that point but still would be more resilient to do it under the lock. Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'fs/io_uring.c')
-rw-r--r--fs/io_uring.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/io_uring.c b/fs/io_uring.c
index be2760ae6c23..5e576878efd9 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -8867,6 +8867,7 @@ static void io_ring_ctx_wait_and_kill(struct io_ring_ctx *ctx)
ctx->cq_overflow_flushed = 1;
if (ctx->rings)
__io_cqring_overflow_flush(ctx, true, NULL, NULL);
+ idr_for_each(&ctx->personality_idr, io_remove_personalities, ctx);
mutex_unlock(&ctx->uring_lock);
io_kill_timeouts(ctx, NULL, NULL);
@@ -8877,7 +8878,6 @@ static void io_ring_ctx_wait_and_kill(struct io_ring_ctx *ctx)
/* if we failed setting up the ctx, we might not have any rings */
io_iopoll_try_reap_events(ctx);
- idr_for_each(&ctx->personality_idr, io_remove_personalities, ctx);
/*
* Do this upfront, so we won't have a grace period where the ring