2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2025-01-24 06:35:44 +08:00
linux-next/drivers/infiniband/ulp
Jack Wang fcf2959da6 RDMA/rtrs-clt: Avoid run destroy_con_cq_qp/create_con_cq_qp in parallel
It could happen two kworkers race with each other:

        CPU0                             CPU1
    addr_resolver kworker           reconnect kworker
    rtrs_clt_rdma_cm_handler
    rtrs_rdma_addr_resolved
    create_con_cq_qp: s.dev_ref++
    "s.dev_ref is 1"
                                    wait in create_cm fails with TIMEOUT
                                    destroy_con_cq_qp: --s.dev_ref
                                    "s.dev_ref is 0"
                                    destroy_con_cq_qp: sess->s.dev = NULL
     rtrs_cq_qp_create -> create_qp(con, sess->dev->ib_pd...)
    sess->dev is NULL, panic.

To fix the problem using mutex to serialize create_con_cq_qp and
destroy_con_cq_qp.

Fixes: 6a98d71dae ("RDMA/rtrs: client: main functionality")
Link: https://lore.kernel.org/r/20201023074353.21946-4-jinpu.wang@cloud.ionos.com
Signed-off-by: Jack Wang <jinpu.wang@cloud.ionos.com>
Reviewed-by: Gioh Kim <gi-oh.kim@cloud.ionos.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
2020-10-28 13:17:39 -03:00
..
ipoib RDMA: Convert sysfs device * show functions to use sysfs_emit() 2020-10-26 19:53:21 -03:00
iser treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
isert IB/isert: add module param to set sg_tablesize for IO cmd 2020-10-28 13:00:49 -03:00
opa_vnic treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
rtrs RDMA/rtrs-clt: Avoid run destroy_con_cq_qp/create_con_cq_qp in parallel 2020-10-28 13:17:39 -03:00
srp RDMA: Convert sysfs device * show functions to use sysfs_emit() 2020-10-26 19:53:21 -03:00
srpt IB/srpt: use new shared CQ mechanism 2020-07-29 09:10:32 -03:00
Makefile RDMA/rtrs: include client and server modules into kernel compilation 2020-05-17 18:57:15 -03:00