aboutsummaryrefslogtreecommitdiffstats
path: root/io_uring/uring_cmd.c
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2025-08-22 08:19:56 -0600
committerJens Axboe <axboe@kernel.dk>2025-08-27 11:24:25 -0600
commit4c0b26e23c79ecf934a92b2d9a516bffbb61c3e4 (patch)
treeb7902b44c0e98b37062e50db2012a703dd9bb241 /io_uring/uring_cmd.c
parentio_uring/zcrx: add support for IORING_SETUP_CQE_MIXED (diff)
downloadlinux-4c0b26e23c79ecf934a92b2d9a516bffbb61c3e4.tar.gz
linux-4c0b26e23c79ecf934a92b2d9a516bffbb61c3e4.zip
io_uring: add async data clear/free helpers
Futex recently had an issue where it mishandled how ->async_data and REQ_F_ASYNC_DATA is handled. To avoid future issues like that, add a set of helpers that either clear or clear-and-free the async data assigned to a struct io_kiocb. Convert existing manual handling of that to use the helpers. No intended functional changes in this patch. Reviewed-by: Caleb Sander Mateos <csander@purestorage.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'io_uring/uring_cmd.c')
-rw-r--r--io_uring/uring_cmd.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/io_uring/uring_cmd.c b/io_uring/uring_cmd.c
index ff1d029633b8..f5a2642bb407 100644
--- a/io_uring/uring_cmd.c
+++ b/io_uring/uring_cmd.c
@@ -37,8 +37,7 @@ static void io_req_uring_cleanup(struct io_kiocb *req, unsigned int issue_flags)
if (io_alloc_cache_put(&req->ctx->cmd_cache, ac)) {
ioucmd->sqe = NULL;
- req->async_data = NULL;
- req->flags &= ~(REQ_F_ASYNC_DATA|REQ_F_NEED_CLEANUP);
+ io_req_async_data_clear(req, REQ_F_NEED_CLEANUP);
}
}