]> git.proxmox.com Git - mirror_ubuntu-jammy-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)
committerStefan Bader <stefan.bader@canonical.com>
Thu, 24 Nov 2022 13:24:42 +0000 (14:24 +0100)
commitf58d757a2cc9516b026b83b7c152f23aa8dde722
tree48432ee411ccc36bc3a634a8fe8d4703513b40a7
parentccea8c9b82646e66daafcaf7b5a7ab61b842afee
RDMA/rxe: Fix resize_finish() in rxe_queue.c

BugLink: https://bugs.launchpad.net/bugs/1996825
[ Upstream commit fda5d0cf8aef12f0a4f714a96a4b2fce039a3e55 ]

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: ae6e843fe08d0 ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/infiniband/sw/rxe/rxe_queue.c