io_uring: allow IORING_OP_ASYNC_CANCEL with 'fd' key
authorJens Axboe <axboe@kernel.dk>
Mon, 18 Apr 2022 16:44:01 +0000 (10:44 -0600)
committerJens Axboe <axboe@kernel.dk>
Wed, 20 Apr 2022 22:36:04 +0000 (16:36 -0600)
commitcd9ef41cd35944899861d3fb708ffcb9db15da7c
tree9782ebf9fd9b9aab6b943b71551f4021e892906f
parent85222d8b6adb5bc2fb48e1bb61f16f3513d3d584
io_uring: allow IORING_OP_ASYNC_CANCEL with 'fd' key

Currently sqe->addr must contain the user_data of the request being
canceled. Introduce the IORING_ASYNC_CANCEL_FD flag, which tells the
kernel that we're keying off the file fd instead for cancelation. This
allows canceling any request that a) uses a file, and b) was assigned the
file based on the value being passed in.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
Link: https://lore.kernel.org/r/20220418164402.75259-5-axboe@kernel.dk
fs/io_uring.c
include/uapi/linux/io_uring.h