Skip to content

Commit 8661d0b

Browse files
committed
io_uring/uring_cmd: explicitly disallow cancelations for IOPOLL
This currently isn't supported, and due to a recent commit, it also cannot easily be supported by io_uring due to hash_node and IOPOLL completion data overlapping. This can be revisited if we ever do support cancelations of requests that have gone to the block stack. Suggested-by: Ming Lei <ming.lei@redhat.com> Reviewed-by: Ming Lei <ming.lei@redhat.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent 697a528 commit 8661d0b

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

io_uring/uring_cmd.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,15 @@ void io_uring_cmd_mark_cancelable(struct io_uring_cmd *cmd,
104104
struct io_kiocb *req = cmd_to_io_kiocb(cmd);
105105
struct io_ring_ctx *ctx = req->ctx;
106106

107+
/*
108+
* Doing cancelations on IOPOLL requests are not supported. Both
109+
* because they can't get canceled in the block stack, but also
110+
* because iopoll completion data overlaps with the hash_node used
111+
* for tracking.
112+
*/
113+
if (ctx->flags & IORING_SETUP_IOPOLL)
114+
return;
115+
107116
if (!(cmd->flags & IORING_URING_CMD_CANCELABLE)) {
108117
cmd->flags |= IORING_URING_CMD_CANCELABLE;
109118
io_ring_submit_lock(ctx, issue_flags);

0 commit comments

Comments
 (0)