]> git.baikalelectronics.ru Git - kernel.git/commit
RDMA/ucma: Fix locking for ctx->events_reported
authorJason Gunthorpe <jgg@nvidia.com>
Tue, 18 Aug 2020 12:05:21 +0000 (15:05 +0300)
committerJason Gunthorpe <jgg@nvidia.com>
Thu, 27 Aug 2020 11:38:15 +0000 (08:38 -0300)
commit25f9e1eb884987aaafce60fe486c99138c40b186
tree6f996802d0abe9e99e700b63ef354b4a72fe65b1
parent7024ef3608314500ed7c29de6c2488d21c683892
RDMA/ucma: Fix locking for ctx->events_reported

This value is locked under the file->mut, ensure it is held whenever
touching it.

The case in ucma_migrate_id() is a race, while in ucma_free_uctx() it is
already not possible for the write side to run, the movement is just for
clarity.

Fixes: 31d9d9a4fd72 ("RDMA/cma: add support for rdma_migrate_id()")
Link: https://lore.kernel.org/r/20200818120526.702120-10-leon@kernel.org
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/infiniband/core/ucma.c