numam-spdk/lib/nvmf
Changpeng Liu 553a6e7ad9 nvmf/vfio-user: fix race condition when free_ctrlr()
This commit fixes a race condition when calling free_ctrlr(),
nvmf_vfio_user_close_qpair->free_qp will set controller `ctrlr->qp[qid] = NULL`
finally, when calling free_ctrlr() we also need to check `ctrlr->qp[qid]`
is NULL or not, when there are multiple IO queues, we need a lock to protect
`ctrlr->qp[qid]`.  However, the call to free_qp() in free_ctrlr() is valid
only when killing SPDK target, for all other cases, e.g: VM disconnected,
the queue pairs are already freed, so here we can process these different
cases separately, and avoid extra lock.

Change-Id: I7ab71f08bf4d737843b2af42e27b1571be0b45e9
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9351
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
2021-09-24 07:43:12 +00:00
..
ctrlr_bdev.c nvmf: In zcopy, delay setting req->data until end of start operation 2021-07-27 14:53:39 +00:00
ctrlr_discovery.c nvmf: remove a bdev_module.h #include 2021-05-11 11:57:01 +00:00
ctrlr.c nvmf: clear ctrlr->listener in remove_listener 2021-09-08 08:08:59 +00:00
fc_ls.c nvmf/fc: Handle out of order fused commands. 2021-01-14 16:18:25 +00:00
fc.c lib/trace: don't pass zero as a non-argument 2021-06-28 16:17:35 +00:00
Makefile nvmf/vfio-user: don't set RESERVATION support for vfio-user transport 2021-08-25 07:27:10 +00:00
nvmf_fc.h nvmf/fc: Add flag to differentiate LS queue and non LS queue. 2021-01-14 16:18:25 +00:00
nvmf_internal.h nvmf: Fix double controller destruction when subsys is deleted 2021-09-08 08:04:04 +00:00
nvmf_rpc.c nvmf: Correct the error path of transport creation. 2021-09-08 08:08:41 +00:00
nvmf.c nvmf: Correct the error path of transport creation. 2021-09-08 08:08:41 +00:00
rdma.c lib/nvmf: removed deprecated stats API 2021-07-23 07:10:03 +00:00
spdk_nvmf.map lib/nvmf : Added support for ZCOPY 2021-07-23 08:34:43 +00:00
subsystem.c test/nvmf/subsystem: cases for restoring ns reservation 2021-09-24 07:42:51 +00:00
tcp.c nvmf: fix error message for per-poll group caches 2021-09-22 13:52:21 +00:00
transport.c nvmf: add interface to dump transport specific listen opts 2021-09-06 09:53:57 +00:00
transport.h nvmf: Allow nvmf_transport_qpair_fini to complete asynchronously. 2020-11-18 11:28:02 +00:00
vfio_user.c nvmf/vfio-user: fix race condition when free_ctrlr() 2021-09-24 07:43:12 +00:00