io_uring: fix return value when removing provided buffers
authorWojciech Lukowicz <wlukowicz01@gmail.com>
Sat, 1 Apr 2023 19:50:38 +0000 (20:50 +0100)
committerJens Axboe <axboe@kernel.dk>
Sat, 1 Apr 2023 22:52:12 +0000 (16:52 -0600)
commitc0921e51dab767ef5adf6175c4a0ba3c6e1074a3
tree5aecc0be7866184e3ef478d41c10f7ed216910c6
parentfd30d1cdcc4ff405fc54765edf2e11b03f2ed4f3
io_uring: fix return value when removing provided buffers

When a request to remove buffers is submitted, and the given number to be
removed is larger than available in the specified buffer group, the
resulting CQE result will be the number of removed buffers + 1, which is
1 more than it should be.

Previously, the head was part of the list and it got removed after the
loop, so the increment was needed. Now, the head is not an element of
the list, so the increment shouldn't be there anymore.

Fixes: dbc7d452e7cf ("io_uring: manage provided buffers strictly ordered")
Signed-off-by: Wojciech Lukowicz <wlukowicz01@gmail.com>
Link: https://lore.kernel.org/r/20230401195039.404909-2-wlukowicz01@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
io_uring/kbuf.c