io_uring/kbuf: Allow the full buffer id space for provided buffers
authorGabriel Krisman Bertazi <krisman@suse.de>
Thu, 5 Oct 2023 00:05:30 +0000 (20:05 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 20 Nov 2023 10:59:11 +0000 (11:59 +0100)
commit464848643e999c964051600bc479527e2a25200e
tree6726d65d7dd8464a620c30e4da99d63329d39419
parentde92bc45c00b0fdde5c261e91e67c38e2d045b07
io_uring/kbuf: Allow the full buffer id space for provided buffers

[ Upstream commit f74c746e476b9dad51448b9a9421aae72b60e25f ]

nbufs tracks the number of buffers and not the last bgid. In 16-bit, we
have 2^16 valid buffers, but the check mistakenly rejects the last
bid. Let's fix it to make the interface consistent with the
documentation.

Fixes: ddf0322db79c ("io_uring: add IORING_OP_PROVIDE_BUFFERS")
Signed-off-by: Gabriel Krisman Bertazi <krisman@suse.de>
Link: https://lore.kernel.org/r/20231005000531.30800-3-krisman@suse.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
io_uring/kbuf.c