RDMA/siw: Fix user page pinning accounting
authorBernard Metzler <bmt@zurich.ibm.com>
Thu, 2 Feb 2023 10:10:00 +0000 (11:10 +0100)
committerLeon Romanovsky <leon@kernel.org>
Mon, 6 Feb 2023 12:46:50 +0000 (14:46 +0200)
commit65a8fc30fb6722fc25adec6d7dd5b53b0bb85820
tree060f96d1fd17895569f8ef31e8d1118509e11fc6
parentef42520240aacfc0d46c8d780c051d135a8dc9b7
RDMA/siw: Fix user page pinning accounting

To avoid racing with other user memory reservations, immediately
account full amount of pages to be pinned.

Fixes: 2251334dcac9 ("rdma/siw: application buffer management")
Reported-by: Jason Gunthorpe <jgg@nvidia.com>
Suggested-by: Alistair Popple <apopple@nvidia.com>
Reviewed-by: Alistair Popple <apopple@nvidia.com>
Signed-off-by: Bernard Metzler <bmt@zurich.ibm.com>
Link: https://lore.kernel.org/r/20230202101000.402990-1-bmt@zurich.ibm.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
drivers/infiniband/sw/siw/siw_mem.c