diff mbox series

[1/1] io_uring/rw: fix error'ed retry return values

Message ID 9754a0970af1861e7865f9014f735c70dc60bf79.1663071587.git.asml.silence@gmail.com (mailing list archive)
State New
Headers show
Series [1/1] io_uring/rw: fix error'ed retry return values | expand

Commit Message

Pavel Begunkov Sept. 13, 2022, 12:21 p.m. UTC
Kernel test robot reports that we test negativity of an unsigned in
io_fixup_rw_res() after a recent change, which masks error codes and
messes up the return value in case I/O is re-retried and failed with
an error.

Fixes: 4d9cb92ca41dd ("io_uring/rw: fix short rw error handling")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
---
 io_uring/rw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jens Axboe Sept. 13, 2022, 1:47 p.m. UTC | #1
On Tue, 13 Sep 2022 13:21:23 +0100, Pavel Begunkov wrote:
> Kernel test robot reports that we test negativity of an unsigned in
> io_fixup_rw_res() after a recent change, which masks error codes and
> messes up the return value in case I/O is re-retried and failed with
> an error.
> 
> 

Applied, thanks!

[1/1] io_uring/rw: fix error'ed retry return values
      commit: 62bb0647b14646fa6c9aa25ecdf67ad18f13523c

Best regards,
diff mbox series

Patch

diff --git a/io_uring/rw.c b/io_uring/rw.c
index 1e18a44adcf5..76ebcfebc9a6 100644
--- a/io_uring/rw.c
+++ b/io_uring/rw.c
@@ -206,7 +206,7 @@  static bool __io_complete_rw_common(struct io_kiocb *req, long res)
 	return false;
 }
 
-static inline unsigned io_fixup_rw_res(struct io_kiocb *req, unsigned res)
+static inline int io_fixup_rw_res(struct io_kiocb *req, long res)
 {
 	struct io_async_rw *io = req->async_data;