]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
io_uring/uring_cmd: correct io_uring_cmd_done() ret type
authorCaleb Sander Mateos <csander@purestorage.com>
Tue, 2 Sep 2025 01:26:07 +0000 (19:26 -0600)
committerJens Axboe <axboe@kernel.dk>
Wed, 3 Sep 2025 23:34:36 +0000 (17:34 -0600)
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>
include/linux/io_uring/cmd.h
io_uring/uring_cmd.c

index 7211157edfe9e60bfaadf3072d3b277a5006b73a..c4d7874016bb8ee1c756fd151d54d0f35adbc1ab 100644 (file)
@@ -56,7 +56,7 @@ int io_uring_cmd_import_fixed_vec(struct io_uring_cmd *ioucmd,
  * Note: the caller should never hard code @issue_flags and is only allowed
  * to pass the mask provided by the core io_uring code.
  */
-void io_uring_cmd_done(struct io_uring_cmd *cmd, ssize_t ret, u64 res2,
+void io_uring_cmd_done(struct io_uring_cmd *cmd, s32 ret, u64 res2,
                        unsigned issue_flags);
 
 void __io_uring_cmd_do_in_task(struct io_uring_cmd *ioucmd,
@@ -104,7 +104,7 @@ static inline int io_uring_cmd_import_fixed_vec(struct io_uring_cmd *ioucmd,
 {
        return -EOPNOTSUPP;
 }
-static inline void io_uring_cmd_done(struct io_uring_cmd *cmd, ssize_t ret,
+static inline void io_uring_cmd_done(struct io_uring_cmd *cmd, s32 ret,
                u64 ret2, unsigned issue_flags)
 {
 }
index d76d6d27765c356c564bd1a9aa46724ddebe8344..5562e8491c5bdaeac073d54d797f073733469c55 100644 (file)
@@ -151,7 +151,7 @@ static inline void io_req_set_cqe32_extra(struct io_kiocb *req,
  * Called by consumers of io_uring_cmd, if they originally returned
  * -EIOCBQUEUED upon receiving the command.
  */
-void io_uring_cmd_done(struct io_uring_cmd *ioucmd, ssize_t ret, u64 res2,
+void io_uring_cmd_done(struct io_uring_cmd *ioucmd, s32 ret, u64 res2,
                       unsigned issue_flags)
 {
        struct io_kiocb *req = cmd_to_io_kiocb(ioucmd);