]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
RDMA/cma: Using the standard locking pattern when delivering the removal event
authorJason Gunthorpe <jgg@nvidia.com>
Thu, 23 Jul 2020 07:07:05 +0000 (10:07 +0300)
committerJason Gunthorpe <jgg@nvidia.com>
Wed, 29 Jul 2020 17:10:02 +0000 (14:10 -0300)
commit3647a28de1ada8708efc78d956619b9df5004478
treede13354c06a3627611d36361fef6301bb44feca4
parentd54f23c09ec62670901f1a2a4712a5218522ca2b
RDMA/cma: Using the standard locking pattern when delivering the removal event

Whenever an event is delivered to the handler it should be done under the
handler_mutex and upon any non-zero return from the handler it should
trigger destruction of the cm_id.

cma_process_remove() skips some steps here, it is not necessarily wrong
since the state change should prevent any races, but it is confusing and
unnecessary.

Follow the standard pattern here, with the slight twist that the
transition to RDMA_CM_DEVICE_REMOVAL includes a cma_cancel_operation().

Link: https://lore.kernel.org/r/20200723070707.1771101-3-leon@kernel.org
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/infiniband/core/cma.c