diff options
| author | Jens Axboe <axboe@kernel.dk> | 2025-01-22 19:50:31 -0700 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2025-02-21 14:11:17 +0100 |
| commit | 8f30a73f361489aa1ec84275f4e9337ce4fee592 (patch) | |
| tree | fbba6d45e5511337eca7c7682c50d258f99f63a6 /io_uring | |
| parent | a7227db1919d0820e4e3ae1d0798b69c660f7f70 (diff) | |
| download | linux-8f30a73f361489aa1ec84275f4e9337ce4fee592.tar.gz linux-8f30a73f361489aa1ec84275f4e9337ce4fee592.tar.bz2 linux-8f30a73f361489aa1ec84275f4e9337ce4fee592.zip | |
io_uring/uring_cmd: cleanup struct io_uring_cmd_data layout
[ Upstream commit eaf72f7b414f5944585e7dee9c915c7f8f7f6344 ]
A few spots in uring_cmd assume that the SQEs copied are always at the
start of the structure, and hence mix req->async_data and the struct
itself.
Clean that up and use the proper indices.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Stable-dep-of: e663da62ba86 ("io_uring/uring_cmd: switch sqe to async_data on EAGAIN")
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'io_uring')
| -rw-r--r-- | io_uring/uring_cmd.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/io_uring/uring_cmd.c b/io_uring/uring_cmd.c index f43adcc16cf6..caed143fb156 100644 --- a/io_uring/uring_cmd.c +++ b/io_uring/uring_cmd.c @@ -201,8 +201,8 @@ static int io_uring_cmd_prep_setup(struct io_kiocb *req, return 0; } - memcpy(req->async_data, sqe, uring_sqe_size(req->ctx)); - ioucmd->sqe = req->async_data; + memcpy(cache->sqes, sqe, uring_sqe_size(req->ctx)); + ioucmd->sqe = cache->sqes; return 0; } @@ -269,7 +269,7 @@ int io_uring_cmd(struct io_kiocb *req, unsigned int issue_flags) struct io_uring_cmd_data *cache = req->async_data; if (ioucmd->sqe != (void *) cache) - memcpy(cache, ioucmd->sqe, uring_sqe_size(req->ctx)); + memcpy(cache->sqes, ioucmd->sqe, uring_sqe_size(req->ctx)); return -EAGAIN; } else if (ret == -EIOCBQUEUED) { return -EIOCBQUEUED; |
