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:52:00 +0000 (11:52 +0100)
commit32b15fef33e8cd067eb4b1bbfa5c73c967b14f93
treef3344b9a5e941ec5bd07a2b264df6bbbb7963132
parent60db638be5f4eb6cecb1de86c545008784ccd749
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