]> www.infradead.org Git - users/jedix/linux-maple.git/commit
io_uring/rw: always clear ->bytes_done on io_async_rw setup
authorJens Axboe <axboe@kernel.dk>
Fri, 27 Dec 2024 16:49:32 +0000 (09:49 -0700)
committerJens Axboe <axboe@kernel.dk>
Fri, 27 Dec 2024 17:09:34 +0000 (10:09 -0700)
commitc5f71916146033f9aba108075ff7087022075fd6
treed927ead0550a7fcc18b967413796d224714b5431
parent21adbcaa8007f5e584d26bebb46ec46bfbbbd330
io_uring/rw: always clear ->bytes_done on io_async_rw setup

A previous commit mistakenly moved the clearing of the in-progress byte
count into the section that's dependent on having a cached iovec or not,
but it should be cleared for any IO. If not, then extra bytes may be
added at IO completion time, causing potentially weird behavior like
over-reporting the amount of IO done.

Fixes: d7f11616edf5 ("io_uring/rw: Allocate async data through helper")
Reported-by: kernel test robot <oliver.sang@intel.com>
Closes: https://lore.kernel.org/oe-lkp/202412271132.a09c3500-lkp@intel.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
io_uring/rw.c