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>
Mon, 25 Apr 2022 00:18:18 +0000 (18:18 -0600)
commit4bf94615b8886305199ed5755cb72fea88258d15
tree964ff739fbcc03dd9577aa501222637fff839c30
parent8e29da69feade64ec7fe9e1a2824b967c5183a21
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