]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
RDMA/ucma: Do not use file->mut to lock destroying
authorJason Gunthorpe <jgg@nvidia.com>
Tue, 18 Aug 2020 12:05:19 +0000 (15:05 +0300)
committerJason Gunthorpe <jgg@nvidia.com>
Thu, 27 Aug 2020 11:38:15 +0000 (08:38 -0300)
commit308571debccd7004acf02ea1b7163a96ad772292
tree75134da6d7a03c9d5fc4ed96eb7bad0de2f5c42c
parentd114c6feedfe0600c19b9f9479a4026354d1f7fd
RDMA/ucma: Do not use file->mut to lock destroying

The only reader of destroying is inside a handler under the handler_mutex,
so directly use the handler_mutex when setting it instead of the larger
file->mut.

As the refcount could be zero here, and the cm_id already freed, and
additional refcount grab around the locking is required to touch the
cm_id.

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