Skip to content

Commit e4e6aae

Browse files
committed
io_uring: clear ->async_data as part of normal init
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]>
1 parent 508c131 commit e4e6aae

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

io_uring/io_uring.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2119,6 +2119,7 @@ static int io_init_req(struct io_ring_ctx *ctx, struct io_kiocb *req,
21192119
req->file = NULL;
21202120
req->tctx = current->io_uring;
21212121
req->cancel_seq_set = false;
2122+
req->async_data = NULL;
21222123

21232124
if (unlikely(opcode >= IORING_OP_LAST)) {
21242125
req->opcode = 0;

0 commit comments

Comments
 (0)