summaryrefslogtreecommitdiffstats
path: root/io_uring/uring_cmd.c
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2022-08-11 09:11:16 +0200
committerJens Axboe <axboe@kernel.dk>2022-08-13 01:01:00 +0200
commit9c71d39aa0f40d4e6bfe14958045a42c722bd327 (patch)
treec9ef83a7b7544d6ea0068c5eaae8ef0d2e0aed91 /io_uring/uring_cmd.c
parentio_uring: make io_kiocb_to_cmd() typesafe (diff)
downloadlinux-9c71d39aa0f40d4e6bfe14958045a42c722bd327.tar.xz
linux-9c71d39aa0f40d4e6bfe14958045a42c722bd327.zip
io_uring: add missing BUILD_BUG_ON() checks for new io_uring_sqe fields
Signed-off-by: Stefan Metzmacher <metze@samba.org> Link: https://lore.kernel.org/r/ffcaf8dc4778db4af673822df60dbda6efdd3065.1660201408.git.metze@samba.org Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'io_uring/uring_cmd.c')
-rw-r--r--io_uring/uring_cmd.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/io_uring/uring_cmd.c b/io_uring/uring_cmd.c
index 478e86a9dfaf..8e0cc2d9205e 100644
--- a/io_uring/uring_cmd.c
+++ b/io_uring/uring_cmd.c
@@ -58,6 +58,9 @@ int io_uring_cmd_prep_async(struct io_kiocb *req)
struct io_uring_cmd *ioucmd = io_kiocb_to_cmd(req, struct io_uring_cmd);
size_t cmd_size;
+ BUILD_BUG_ON(uring_cmd_pdu_size(0) != 16);
+ BUILD_BUG_ON(uring_cmd_pdu_size(1) != 80);
+
cmd_size = uring_cmd_pdu_size(req->ctx->flags & IORING_SETUP_SQE128);
memcpy(req->async_data, ioucmd->cmd, cmd_size);