Skip to content

Commit 6b393a1

Browse files
isilenceaxboe
authored andcommitted
io_uring: fix false positive sqo warning on flush
WARNING: CPU: 1 PID: 9094 at fs/io_uring.c:8884 io_disable_sqo_submit+0x106/0x130 fs/io_uring.c:8884 Call Trace: io_uring_flush+0x28b/0x3a0 fs/io_uring.c:9099 filp_close+0xb4/0x170 fs/open.c:1280 close_fd+0x5c/0x80 fs/file.c:626 __do_sys_close fs/open.c:1299 [inline] __se_sys_close fs/open.c:1297 [inline] __x64_sys_close+0x2f/0xa0 fs/open.c:1297 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 io_uring's final close() may be triggered by any task not only the creator. It's well handled by io_uring_flush() including SQPOLL case, though a warning in io_disable_sqo_submit() will fallaciously fire by moving this warning out to the only call site that matters. Reported-by: [email protected] Signed-off-by: Pavel Begunkov <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent c93cc9e commit 6b393a1

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

fs/io_uring.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8918,8 +8918,6 @@ static void __io_uring_cancel_task_requests(struct io_ring_ctx *ctx,
89188918

89198919
static void io_disable_sqo_submit(struct io_ring_ctx *ctx)
89208920
{
8921-
WARN_ON_ONCE(ctx->sqo_task != current);
8922-
89238921
mutex_lock(&ctx->uring_lock);
89248922
ctx->sqo_dead = 1;
89258923
mutex_unlock(&ctx->uring_lock);
@@ -8941,6 +8939,7 @@ static void io_uring_cancel_task_requests(struct io_ring_ctx *ctx,
89418939

89428940
if ((ctx->flags & IORING_SETUP_SQPOLL) && ctx->sq_data) {
89438941
/* for SQPOLL only sqo_task has task notes */
8942+
WARN_ON_ONCE(ctx->sqo_task != current);
89448943
io_disable_sqo_submit(ctx);
89458944
task = ctx->sq_data->thread;
89468945
atomic_inc(&task->io_uring->in_idle);

0 commit comments

Comments
 (0)