Skip to content
Snippets Groups Projects
Commit 0a535edd authored by Jens Axboe's avatar Jens Axboe
Browse files

io_uring/rw: ensure io->bytes_done is always initialized


If IOSQE_ASYNC is set and we fail importing an iovec for a readv or
writev request, then we leave ->bytes_done uninitialized and hence the
eventual failure CQE posted can potentially have a random res value
rather than the expected -EINVAL.

Setup ->bytes_done before potentially failing, so we have a consistent
value if we fail the request early.

Cc: stable@vger.kernel.org
Reported-by: default avatarxingwei lee <xrivendell7@gmail.com>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 6e5e6d27
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment