io_uring/rw: fix cflags posting for single issue multishot read
authorJens Axboe <axboe@kernel.dk>
Sun, 6 Oct 2024 01:06:50 +0000 (19:06 -0600)
committerJens Axboe <axboe@kernel.dk>
Sun, 6 Oct 2024 14:05:47 +0000 (08:05 -0600)
commitc9d952b9103b600ddafc5d1c0e2f2dbd30f0b805
tree6c6a31bb2beb395735997f4756a3bb33afa6bf8a
parentc314094cb4cfa6fc5a17f4881ead2dfebfa717a7
io_uring/rw: fix cflags posting for single issue multishot read

If multishot gets disabled, and hence the request will get terminated
rather than persist for more iterations, then posting the CQE with the
right cflags is still important. Most notably, the buffer reference
needs to be included.

Refactor the return of __io_read() a bit, so that the provided buffer
is always put correctly, and hence returned to the application.

Reported-by: Sharon Rosner <Sharon Rosner>
Link: https://github.com/axboe/liburing/issues/1257
Cc: stable@vger.kernel.org
Fixes: 2a975d426c82 ("io_uring/rw: don't allow multishot reads without NOWAIT support")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
io_uring/rw.c