Files
Jens Axboe 8d1c3a1f2f io_uring/uring_cmd: only cancel requests of the given task
io_uring_try_cancel_uring_cmd() ignores the task it is asked to cancel
on behalf of as soon as cancel_all is true, and cancels every cancelable
command on the ring instead. That differs from how other requests are
matched, where a valid task always restricts matching to that task's
requests and cancel_all simply lifts the REQ_F_INFLIGHT restriction.

So far the only caller passing both a task and cancel_all is exec, where
tearing down another task's commands on a shared ring is somewhat
impolite. The exit path is about to do the same for every exiting
process though, so bring it in line. Match on the task if one is given,
and cancel everything only for ring teardown, which passes NULL. This
leaves cancel_all as useless, hence drop it.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
2026-09-28 11:47:28 -06:00

27 lines
798 B
C

// SPDX-License-Identifier: GPL-2.0
#include <linux/io_uring/cmd.h>
#include <linux/io_uring_types.h>
struct io_async_cmd {
struct iou_vec vec;
struct io_uring_sqe sqes[2];
};
int io_uring_cmd(struct io_kiocb *req, unsigned int issue_flags);
int io_uring_cmd_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe);
void io_uring_cmd_sqe_copy(struct io_kiocb *req);
void io_uring_cmd_cleanup(struct io_kiocb *req);
bool io_uring_try_cancel_uring_cmd(struct io_ring_ctx *ctx,
struct io_uring_task *tctx);
bool io_uring_cmd_post_mshot_cqe32(struct io_uring_cmd *cmd,
unsigned int issue_flags,
struct io_uring_cqe cqe[2]);
void io_cmd_cache_free(const void *entry);
int io_cmd_poll_multishot(struct io_uring_cmd *cmd,
unsigned int issue_flags, __poll_t mask);