summaryrefslogtreecommitdiffstats
path: root/io_uring/statx.c
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2022-08-11 09:11:15 +0200
committerJens Axboe <axboe@kernel.dk>2022-08-13 01:01:00 +0200
commitf2ccb5aed7bce1d8b3ed5b3385759a5509663028 (patch)
tree32c78d3576a1e594aab4dca3c36efb6ee5dcd93e /io_uring/statx.c
parentfs: don't randomize struct kiocb fields (diff)
downloadlinux-f2ccb5aed7bce1d8b3ed5b3385759a5509663028.tar.xz
linux-f2ccb5aed7bce1d8b3ed5b3385759a5509663028.zip
io_uring: make io_kiocb_to_cmd() typesafe
We need to make sure (at build time) that struct io_cmd_data is not casted to a structure that's larger. Signed-off-by: Stefan Metzmacher <metze@samba.org> Link: https://lore.kernel.org/r/c024cdf25ae19fc0319d4180e2298bade8ed17b8.1660201408.git.metze@samba.org Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'io_uring/statx.c')
-rw-r--r--io_uring/statx.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/io_uring/statx.c b/io_uring/statx.c
index 6056cd7f4876..d8fc933d3f59 100644
--- a/io_uring/statx.c
+++ b/io_uring/statx.c
@@ -22,7 +22,7 @@ struct io_statx {
int io_statx_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe)
{
- struct io_statx *sx = io_kiocb_to_cmd(req);
+ struct io_statx *sx = io_kiocb_to_cmd(req, struct io_statx);
const char __user *path;
if (sqe->buf_index || sqe->splice_fd_in)
@@ -53,7 +53,7 @@ int io_statx_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe)
int io_statx(struct io_kiocb *req, unsigned int issue_flags)
{
- struct io_statx *sx = io_kiocb_to_cmd(req);
+ struct io_statx *sx = io_kiocb_to_cmd(req, struct io_statx);
int ret;
if (issue_flags & IO_URING_F_NONBLOCK)
@@ -66,7 +66,7 @@ int io_statx(struct io_kiocb *req, unsigned int issue_flags)
void io_statx_cleanup(struct io_kiocb *req)
{
- struct io_statx *sx = io_kiocb_to_cmd(req);
+ struct io_statx *sx = io_kiocb_to_cmd(req, struct io_statx);
if (sx->filename)
putname(sx->filename);