• Jens Axboe's avatar
    io_uring: ensure registered buffer import returns the IO length · 5e559561
    Jens Axboe authored
    A test case was reported where two linked reads with registered buffers
    failed the second link always. This is because we set the expected value
    of a request in req->result, and if we don't get this result, then we
    fail the dependent links. For some reason the registered buffer import
    returned -ERROR/0, while the normal import returns -ERROR/length. This
    broke linked commands with registered buffers.
    
    Fix this by making io_import_fixed() correctly return the mapped length.
    
    Cc: stable@vger.kernel.org # v5.3
    Reported-by: default avatar李通洲 <carter.li@eoitek.com>
    Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
    5e559561
io_uring.c 96.1 KB