projects/linux·commit e4e6aaea

io_uring: clear ->async_data as part of normal init

e4e6aaea · Jens Axboe <[email protected]> · 2025-08-21 13:24:57 -06:00

Opcode handlers like POLL_ADD will use ->async_data as the pointer for
double poll handling, which is a bit different than the usual case
where it's strictly gated by the REQ_F_ASYNC_DATA flag. Be a bit more
proactive in handling ->async_data, and clear it to NULL as part of
regular init. Init is touching that cacheline anyway, so might as well
clear it.

Signed-off-by: Jens Axboe <[email protected]>
Commit
e4e6aaea46b7be818eba0510ba68d30df8689ea3
Parents
508c1314

Changes

1 files changed · +1 −0

FileStatusAddDelContent
io_uring/io_uring.cmodified+1−0View file

io_uring/io_uring.c

View file
diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c
index 4ef69dd..9363361 100644
--- a/io_uring/io_uring.c
+++ b/io_uring/io_uring.c
@@ -2119,6 +2119,7 @@ static int io_init_req(struct io_ring_ctx *ctx, struct io_kiocb *req,
req->file = NULL;
req->tctx = current->io_uring;
req->cancel_seq_set = false;
+ req->async_data = NULL;
if (unlikely(opcode >= IORING_OP_LAST)) {
req->opcode = 0;