Spdk/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 bdev: allow NULL md_buf for md-related APIs 2022-07-11 22:41:35 +00:00
blob blobstore: implement spdk_bs_grow and bdev_lvol_grow_lvstore RPC 2022-06-28 17:55:43 +00:00
blobfs util: Extract a common lib between iovs and buf. 2022-06-20 10:01:15 +00:00
conf Replace most BSD 3-clause license text with SPDX identifier. 2022-06-09 07:35:12 +00:00
dma check_format: For C files only, fix return type breaks 2022-06-27 09:33:48 +00:00
env_dpdk check_format: For C files only, fix return type breaks 2022-06-27 09:33:48 +00:00
env_ocf check_format: For C files only, fix return type breaks 2022-06-27 09:33:48 +00:00
event lib/event: do not set default scheduling period during init 2022-06-20 09:56:09 +00:00
ftl ftl: configuration structure and utils 2022-07-11 07:23:58 +00:00
idxd Replace most BSD 3-clause license text with SPDX identifier. 2022-06-09 07:35:12 +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 Replace most BSD 3-clause license text with SPDX identifier. 2022-06-09 07:35:12 +00:00
lvol blobstore: implement spdk_bs_grow and bdev_lvol_grow_lvstore RPC 2022-06-28 17:55:43 +00:00
nbd check_format: For C files only, fix return type breaks 2022-06-27 09:33:48 +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 nvmf: decrement mgmt_io_outstanding for all AER cases 2022-07-15 12:51:31 +00:00
rdma Replace most BSD 3-clause license text with SPDX identifier. 2022-06-09 07:35:12 +00:00
reduce check_format: For C files only, fix return type breaks 2022-06-27 09:33:48 +00:00
rocksdb Replace most BSD 3-clause license text with SPDX identifier. 2022-06-09 07:35:12 +00:00
rpc Replace most BSD 3-clause license text with SPDX identifier. 2022-06-09 07:35:12 +00:00
scsi check_format: For C files only, fix return type breaks 2022-06-27 09:33:48 +00:00
sock sock: asynchronous readv interface 2022-07-14 09:45:54 +00:00
thread thread: let spdk_thread_create() accept const spdk_cpuset* 2022-06-24 07:22:53 +00:00
trace Replace most BSD 3-clause license text with SPDX identifier. 2022-06-09 07:35:12 +00:00
trace_parser Replace most BSD 3-clause license text with SPDX identifier. 2022-06-09 07:35:12 +00:00
ut_mock 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
vfio_user lib/vfio_user: change the calculation of bar_addr 2022-06-15 08:10:32 +00:00
vhost vhost/rpc: return errno from virtio_blk_create_transport 2022-07-11 07:41:22 +00:00
virtio Replace most BSD 3-clause license text with SPDX identifier. 2022-06-09 07:35:12 +00:00
vmd Replace most BSD 3-clause license text with SPDX identifier. 2022-06-09 07:35:12 +00:00
Makefile ftl: core structure 2022-07-11 07:23:58 +00:00