lkml.org 
[lkml]   [2022]   [Oct]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.15 514/530] io_uring/rw: fix errored retry return values
    Date
    From: Pavel Begunkov <asml.silence@gmail.com>

    [ upstream commit 62bb0647b14646fa6c9aa25ecdf67ad18f13523c ]

    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>
    Link: https://lore.kernel.org/r/9754a0970af1861e7865f9014f735c70dc60bf79.1663071587.git.asml.silence@gmail.com
    Signed-off-by: Jens Axboe <axboe@kernel.dk>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    ---
    fs/io_uring.c | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    --- a/fs/io_uring.c
    +++ b/fs/io_uring.c
    @@ -2701,7 +2701,7 @@ static bool __io_complete_rw_common(stru
    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, unsigned res)
    {
    struct io_async_rw *io = req->async_data;


    \
     
     \ /
      Last update: 2022-10-24 18:59    [W:4.041 / U:0.308 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site