OSDN Git Service

RDMA/ucma: Fix the locking of ctx->file
authorJason Gunthorpe <jgg@nvidia.com>
Tue, 18 Aug 2020 12:05:20 +0000 (15:05 +0300)
committerJason Gunthorpe <jgg@nvidia.com>
Thu, 27 Aug 2020 11:38:15 +0000 (08:38 -0300)
commit09e328e47a695b0d346598f5d6593ee598e64885
tree635c7de0cf2fb35f54c7661ef204ffd90dc99208
parent308571debccd7004acf02ea1b7163a96ad772292
RDMA/ucma: Fix the locking of ctx->file

ctx->file is changed under the file->mut lock by ucma_migrate_id(), which
is impossible to lock correctly. Instead change ctx->file under the
handler_lock and ctx_table lock and revise all places touching ctx->file
to use this locking when reading ctx->file.

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