io_uring/msg_ring: let target know allocated index
authorPavel Begunkov <asml.silence@gmail.com>
Thu, 16 Mar 2023 12:11:42 +0000 (12:11 +0000)
committerJens Axboe <axboe@kernel.dk>
Thu, 16 Mar 2023 13:16:56 +0000 (07:16 -0600)
commit5da28edd7bd5518f97175ecea77615bb729a7a28
treed00dc888b905173c9aed559cf98fdae220a99ed9
parent6acd352dfee558194643adbed7e849fe80fd1b93
io_uring/msg_ring: let target know allocated index

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: e6130eba8a848 ("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>
io_uring/msg_ring.c