]> git.baikalelectronics.ru Git - kernel.git/commit
RDMA/rxe: Fix resize_finish() in rxe_queue.c
authorBob Pearson <rpearsonhpe@gmail.com>
Thu, 25 Aug 2022 22:14:47 +0000 (17:14 -0500)
committerJason Gunthorpe <jgg@nvidia.com>
Tue, 27 Sep 2022 13:15:24 +0000 (10:15 -0300)
commitd37381fdf6da62995ee89777b25e894ef27a9cb6
tree7801ed159a53b21e3e7e5a805183ff9ccd22f197
parent776a9c21753bb1616831c7e4729f54993c13b05c
RDMA/rxe: Fix resize_finish() in rxe_queue.c

Currently in resize_finish() in rxe_queue.c there is a loop which copies
the entries in the original queue into a newly allocated queue.  The
termination logic for this loop is incorrect. The call to
queue_next_index() updates cons but has no effect on whether the queue is
empty. So if the queue starts out empty nothing is copied but if it is not
then the loop will run forever. This patch changes the loop to compare the
value of cons to the original producer index.

Fixes: cdcddbfd576ac ("RDMA/rxe: Add memory barriers to kernel queues")
Link: https://lore.kernel.org/r/20220825221446.6512-1-rpearsonhpe@gmail.com
Signed-off-by: Bob Pearson <rpearsonhpe@gmail.com>
Reviewed-by: Li Zhijian <lizhijian@fujitsu.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/infiniband/sw/rxe/rxe_queue.c