summaryrefslogtreecommitdiffstats
path: root/io_uring/cancel.c
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2023-06-22 21:03:52 +0200
committerJens Axboe <axboe@kernel.dk>2023-07-17 18:05:48 +0200
commitf77569d22ad91dc25de294864fa5b24d37ddc149 (patch)
tree6cc781b0a3c8255d18c52a657c4d2e5cc38c1e6b /io_uring/cancel.c
parentio_uring/cancel: support opcode based lookup and cancelation (diff)
downloadlinux-f77569d22ad91dc25de294864fa5b24d37ddc149.tar.xz
linux-f77569d22ad91dc25de294864fa5b24d37ddc149.zip
io_uring/cancel: wire up IORING_ASYNC_CANCEL_OP for sync cancel
Allow usage of IORING_ASYNC_CANCEL_OP through the sync cancelation API as well. Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'io_uring/cancel.c')
-rw-r--r--io_uring/cancel.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/io_uring/cancel.c b/io_uring/cancel.c
index d91116b032eb..7b23607cf4af 100644
--- a/io_uring/cancel.c
+++ b/io_uring/cancel.c
@@ -265,17 +265,22 @@ int io_sync_cancel(struct io_ring_ctx *ctx, void __user *arg)
struct io_uring_sync_cancel_reg sc;
struct fd f = { };
DEFINE_WAIT(wait);
- int ret;
+ int ret, i;
if (copy_from_user(&sc, arg, sizeof(sc)))
return -EFAULT;
if (sc.flags & ~CANCEL_FLAGS)
return -EINVAL;
- if (sc.pad[0] || sc.pad[1] || sc.pad[2] || sc.pad[3])
- return -EINVAL;
+ for (i = 0; i < ARRAY_SIZE(sc.pad); i++)
+ if (sc.pad[i])
+ return -EINVAL;
+ for (i = 0; i < ARRAY_SIZE(sc.pad2); i++)
+ if (sc.pad2[i])
+ return -EINVAL;
cd.data = sc.addr;
cd.flags = sc.flags;
+ cd.opcode = sc.opcode;
/* we can grab a normal file descriptor upfront */
if ((cd.flags & IORING_ASYNC_CANCEL_FD) &&