summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorPavel Begunkov <asml.silence@gmail.com>2024-11-04 16:12:04 +0000
committerDavid Sterba <dsterba@suse.com>2024-11-11 14:34:21 +0100
commitdf3b8ca604f224eb4cd51669416ad4d607682273 (patch)
tree45a904dc05cc644fe83b89d1be23b5ded5534bd2 /include/linux
parent1cc86aeadafd667c381c588a84fdef2d5e8093a5 (diff)
io_uring/cmd: let cmds to know about dying task
When the taks that submitted a request is dying, a task work for that request might get run by a kernel thread or even worse by a half dismantled task. We can't just cancel the task work without running the callback as the cmd might need to do some clean up, so pass a flag instead. If set, it's not safe to access any task resources and the callback is expected to cancel the cmd ASAP. Reviewed-by: Jens Axboe <axboe@kernel.dk> Reviewed-by: Ming Lei <ming.lei@redhat.com> Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/io_uring_types.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/io_uring_types.h b/include/linux/io_uring_types.h
index 4b9ba523978d..2ee5dc105b58 100644
--- a/include/linux/io_uring_types.h
+++ b/include/linux/io_uring_types.h
@@ -37,6 +37,7 @@ enum io_uring_cmd_flags {
/* set when uring wants to cancel a previously issued command */
IO_URING_F_CANCEL = (1 << 11),
IO_URING_F_COMPAT = (1 << 12),
+ IO_URING_F_TASK_DEAD = (1 << 13),
};
struct io_wq_work_node {