io_uring: fix xa_alloc_cycle() error return value check
authorJens Axboe <axboe@kernel.dk>
Tue, 24 Aug 2021 12:15:01 +0000 (13:15 +0100)
committerSasha Levin <sashal@kernel.org>
Thu, 26 Aug 2021 12:35:57 +0000 (08:35 -0400)
commit695ab28a7fa107d0350ab19eba8ec89fac45a95d
tree9fcb918daaaab03ce26f6455e64279016e502c21
parent0d5fcfc6406ee7138ca0141769f90a37d4b4ae8b
io_uring: fix xa_alloc_cycle() error return value check

[ upstream commit a30f895ad3239f45012e860d4f94c1a388b36d14 ]

We currently check for ret != 0 to indicate error, but '1' is a valid
return and just indicates that the allocation succeeded with a wrap.
Correct the check to be for < 0, like it was before the xarray
conversion.

Cc: stable@vger.kernel.org
Fixes: 61cf93700fe6 ("io_uring: Convert personality_idr to XArray")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/io_uring.c