Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

io_uring/uring_cmd: correct io_uring_cmd_done() ret type

io_uring_cmd_done() takes the result code for the CQE as a ssize_t ret
argument. However, the CQE res field is a s32 value, as is the argument
to io_req_set_res(). To clarify that only s32 values can be faithfully
represented without truncation, change io_uring_cmd_done()'s ret
argument type to s32.

Signed-off-by: Caleb Sander Mateos <csander@purestorage.com>
Link: https://lore.kernel.org/r/20250902012609.1513123-1-csander@purestorage.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Caleb Sander Mateos and committed by
Jens Axboe
dd386b0d df3a7762

+3 -3
+2 -2
include/linux/io_uring/cmd.h
··· 56 56 * Note: the caller should never hard code @issue_flags and is only allowed 57 57 * to pass the mask provided by the core io_uring code. 58 58 */ 59 - void io_uring_cmd_done(struct io_uring_cmd *cmd, ssize_t ret, u64 res2, 59 + void io_uring_cmd_done(struct io_uring_cmd *cmd, s32 ret, u64 res2, 60 60 unsigned issue_flags); 61 61 62 62 void __io_uring_cmd_do_in_task(struct io_uring_cmd *ioucmd, ··· 104 104 { 105 105 return -EOPNOTSUPP; 106 106 } 107 - static inline void io_uring_cmd_done(struct io_uring_cmd *cmd, ssize_t ret, 107 + static inline void io_uring_cmd_done(struct io_uring_cmd *cmd, s32 ret, 108 108 u64 ret2, unsigned issue_flags) 109 109 { 110 110 }
+1 -1
io_uring/uring_cmd.c
··· 151 151 * Called by consumers of io_uring_cmd, if they originally returned 152 152 * -EIOCBQUEUED upon receiving the command. 153 153 */ 154 - void io_uring_cmd_done(struct io_uring_cmd *ioucmd, ssize_t ret, u64 res2, 154 + void io_uring_cmd_done(struct io_uring_cmd *ioucmd, s32 ret, u64 res2, 155 155 unsigned issue_flags) 156 156 { 157 157 struct io_kiocb *req = cmd_to_io_kiocb(ioucmd);