io_uring: ensure only sqo_task has file notes
For SQPOLL io_uring we want to have only one file note held by sqo_task. Add a warning to make sure it holds. It's deep in io_uring_add_task_file() out of hot path, so shouldn't hurt. Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
committed by
Jens Axboe
parent
0bead8cd39
commit
ecfc849282
@@ -9099,6 +9099,10 @@ static int io_uring_add_task_file(struct io_ring_ctx *ctx, struct file *file)
|
|||||||
fput(file);
|
fput(file);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* one and only SQPOLL file note, held by sqo_task */
|
||||||
|
WARN_ON_ONCE((ctx->flags & IORING_SETUP_SQPOLL) &&
|
||||||
|
current != ctx->sqo_task);
|
||||||
}
|
}
|
||||||
tctx->last = file;
|
tctx->last = file;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user