]> git.baikalelectronics.ru Git - kernel.git/commit
io_uring/msg_ring: let target know allocated index
authorPavel Begunkov <asml.silence@gmail.com>
Mon, 20 Mar 2023 13:05:02 +0000 (07:05 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 Mar 2023 12:34:06 +0000 (13:34 +0100)
commit6dc5c797710ede18f961b538a74dc3c0e7b48a71
treeaf75576cadd19bfa3a316d42d967a3429c8e52b9
parent8e0b04f668772f19375bc9c8bc8a89935278ba0a
io_uring/msg_ring: let target know allocated index

commit 555f426c0eee43e4a5f8e011f0a20aa896462278 upstream.

msg_ring requests transferring files support auto index selection via
IORING_FILE_INDEX_ALLOC, however they don't return the selected index
to the target ring and there is no other good way for the userspace to
know where is the receieved file.

Return the index for allocated slots and 0 otherwise, which is
consistent with other fixed file installing requests.

Cc: stable@vger.kernel.org # v6.0+
Fixes: 08835f2466589 ("io_uring: add support for passing fixed file descriptors")
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://github.com/axboe/liburing/issues/809
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
io_uring/msg_ring.c