]> www.infradead.org Git - nvme.git/commit
io_uring: do not clamp read length for multishot read
authorDylan Yudaken <dyudaken@gmail.com>
Mon, 6 Nov 2023 20:39:09 +0000 (20:39 +0000)
committerJens Axboe <axboe@kernel.dk>
Mon, 6 Nov 2023 20:41:58 +0000 (13:41 -0700)
commite53759298a7d7e98c3e5c2440d395d19cea7d6bf
tree1ab396faf11311cf29028c47f4ea769cf96f0e35
parent49fbe99486786661994a55ced855c31d966bbdf0
io_uring: do not clamp read length for multishot read

When doing a multishot read, the code path reuses the old read
paths. However this breaks an assumption built into those paths,
namely that struct io_rw::len is available for reuse by __io_import_iovec.

For multishot this results in len being set for the first receive
call, and then subsequent calls are clamped to that buffer length
incorrectly.

Instead keep len as zero after recycling buffers, to reuse the full
buffer size of the next selected buffer.

Fixes: fc68fcda0491 ("io_uring/rw: add support for IORING_OP_READ_MULTISHOT")
Signed-off-by: Dylan Yudaken <dyudaken@gmail.com>
Link: https://lore.kernel.org/r/20231106203909.197089-4-dyudaken@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
io_uring/rw.c