Skip to content

Commit a07d2d7

Browse files
bsberndaxboe
authored andcommitted
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]>
1 parent cdd30eb commit a07d2d7

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

include/linux/io_uring/cmd.h

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

4949
void __io_uring_cmd_do_in_task(struct io_uring_cmd *ioucmd,
@@ -67,7 +67,7 @@ static inline int io_uring_cmd_import_fixed(u64 ubuf, unsigned long len, int rw,
6767
return -EOPNOTSUPP;
6868
}
6969
static inline void io_uring_cmd_done(struct io_uring_cmd *cmd, ssize_t ret,
70-
ssize_t ret2, unsigned issue_flags)
70+
u64 ret2, unsigned issue_flags)
7171
{
7272
}
7373
static inline void __io_uring_cmd_do_in_task(struct io_uring_cmd *ioucmd,

io_uring/uring_cmd.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ static inline void io_req_set_cqe32_extra(struct io_kiocb *req,
151151
* Called by consumers of io_uring_cmd, if they originally returned
152152
* -EIOCBQUEUED upon receiving the command.
153153
*/
154-
void io_uring_cmd_done(struct io_uring_cmd *ioucmd, ssize_t ret, ssize_t res2,
154+
void io_uring_cmd_done(struct io_uring_cmd *ioucmd, ssize_t ret, u64 res2,
155155
unsigned issue_flags)
156156
{
157157
struct io_kiocb *req = cmd_to_io_kiocb(ioucmd);

0 commit comments

Comments
 (0)