Skip to content

Commit 642373b

Browse files
author
Ming Lei
committed
io_uring: Change res2 parameter type in io_uring_cmd_done
JIRA: https://issues.redhat.com/browse/RHEL-106845 commit a07d2d7 Author: Bernd Schubert <[email protected]> Date: Tue Dec 3 11:31:05 2024 +0100 io_uring: Change res2 parameter type in io_uring_cmd_done Change the type of the res2 parameter in io_uring_cmd_done from ssize_t to u64. This aligns the parameter type with io_req_set_cqe32_extra, which expects u64 arguments. The change eliminates potential issues on 32-bit architectures where ssize_t might be 32-bit. Only user of passing res2 is drivers/nvme/host/ioctl.c and it actually passes u64. Fixes: ee692a2 ("fs,io_uring: add infrastructure for uring-cmd") Cc: [email protected] Reviewed-by: Kanchan Joshi <[email protected]> Tested-by: Li Zetao <[email protected]> Reviewed-by: Li Zetao <[email protected]> Signed-off-by: Bernd Schubert <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]> Signed-off-by: Ming Lei <[email protected]>
1 parent 92d65f3 commit 642373b

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

include/linux/io_uring/cmd.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ int io_uring_cmd_import_fixed(u64 ubuf, unsigned long len, int rw,
4444
* Note: the caller should never hard code @issue_flags and is only allowed
4545
* to pass the mask provided by the core io_uring code.
4646
*/
47-
void io_uring_cmd_done(struct io_uring_cmd *cmd, ssize_t ret, ssize_t res2,
47+
void io_uring_cmd_done(struct io_uring_cmd *cmd, ssize_t ret, u64 res2,
4848
unsigned issue_flags);
4949

5050
void __io_uring_cmd_do_in_task(struct io_uring_cmd *ioucmd,
@@ -69,7 +69,7 @@ static inline int io_uring_cmd_import_fixed(u64 ubuf, unsigned long len, int rw,
6969
return -EOPNOTSUPP;
7070
}
7171
static inline void io_uring_cmd_done(struct io_uring_cmd *cmd, ssize_t ret,
72-
ssize_t ret2, unsigned issue_flags)
72+
u64 ret2, unsigned issue_flags)
7373
{
7474
}
7575
static inline void __io_uring_cmd_do_in_task(struct io_uring_cmd *ioucmd,

io_uring/uring_cmd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ static inline void io_req_set_cqe32_extra(struct io_kiocb *req,
147147
* Called by consumers of io_uring_cmd, if they originally returned
148148
* -EIOCBQUEUED upon receiving the command.
149149
*/
150-
void io_uring_cmd_done(struct io_uring_cmd *ioucmd, ssize_t ret, ssize_t res2,
150+
void io_uring_cmd_done(struct io_uring_cmd *ioucmd, ssize_t ret, u64 res2,
151151
unsigned issue_flags)
152152
{
153153
struct io_kiocb *req = cmd_to_io_kiocb(ioucmd);

0 commit comments

Comments
 (0)