Spdk/test/unit/lib
Alexey Marchuk 3512714b3f nvme_fabrics: Lock mutext when prcessing set/get regs
That is possible to get/set registers from any thread,
during regs processing we are polling admin qpair to
get a completion. At the same time, another thread
can also poll admin qpair and that can lead to
undefined behavior.

This patch fixes an issue when bdev_nvme is configured
with io_timeout. If remote target becomes unresponsive
(e.g. due to link down), IO timeout occurs and bdev_nvme
tries to get csts registers in timeout_cb. At the same
time another thread can process adminq, so we may have
2 simultaneous adminq polls. If admin qpair is disconnecting
at that time (RDMA transport) we may destroy resources
twice from different threads.

We don't see a problem with set_regs function but it
won't be redundant to lock mutex in set_regs as well.

Signed-off-by: Alexey Marchuk <alexeymar@nvidia.com>
Change-Id: I7ec3984d25d0249061005533d13b22315b44ddf2
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/13687
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2022-07-15 16:06:54 +00:00
..
accel check_format: For C files only, fix return type breaks 2022-06-27 09:33:48 +00:00
bdev raid/concat: update bdev readv/writev to ext API. 2022-07-14 09:46:56 +00:00
blob blobstore: implement spdk_bs_grow and bdev_lvol_grow_lvstore RPC 2022-06-28 17:55:43 +00:00
blobfs check_format: For C files only, fix return type breaks 2022-06-27 09:33:48 +00:00
dma Replace most BSD 3-clause license text with SPDX identifier. 2022-06-09 07:35:12 +00:00
env_dpdk check_format: For C files only, fix return type breaks 2022-06-27 09:33:48 +00:00
event Replace most BSD 3-clause license text with SPDX identifier. 2022-06-09 07:35:12 +00:00
ftl ftl: management framework 2022-07-11 07:23:58 +00:00
idxd check_format: For C files only, fix return type breaks 2022-06-27 09:33:48 +00:00
init Replace most BSD 3-clause license text with SPDX identifier. 2022-06-09 07:35:12 +00:00
ioat check_format: For C files only, fix return type breaks 2022-06-27 09:33:48 +00:00
iscsi check_format: For C files only, fix return type breaks 2022-06-27 09:33:48 +00:00
json check_format: For C files only, fix return type breaks 2022-06-27 09:33:48 +00:00
jsonrpc check_format: For C files only, fix return type breaks 2022-06-27 09:33:48 +00:00
log check_format: For C files only, fix return type breaks 2022-06-27 09:33:48 +00:00
lvol blobstore: implement spdk_bs_grow and bdev_lvol_grow_lvstore RPC 2022-06-28 17:55:43 +00:00
notify Replace most BSD 3-clause license text with SPDX identifier. 2022-06-09 07:35:12 +00:00
nvme nvme_fabrics: Lock mutext when prcessing set/get regs 2022-07-15 16:06:54 +00:00
nvmf lib/nvmf: optimize the performance for h2c handle 2022-07-11 07:40:53 +00:00
reduce check_format: For C files only, fix return type breaks 2022-06-27 09:33:48 +00:00
rpc check_format: For C files only, fix return type breaks 2022-06-27 09:33:48 +00:00
scsi check_format: For C files only, fix return type breaks 2022-06-27 09:33:48 +00:00
sock UT/sock:add test case for the struct sock_net_impl 2022-07-14 09:47:29 +00:00
thread Replace most BSD 3-clause license text with SPDX identifier. 2022-06-09 07:35:12 +00:00
util util: Extract a common lib between iovs and buf. 2022-06-20 10:01:15 +00:00
vhost check_format: For C files only, fix return type breaks 2022-06-27 09:33:48 +00:00
json_mock.c Replace most BSD 3-clause license text with SPDX identifier. 2022-06-09 07:35:12 +00:00
Makefile ftl: management framework 2022-07-11 07:23:58 +00:00