Spdk/test
Shuhei Matsumoto 2826ef13ce bdev/nvme: Fail reset sequence immediately if ctrlr is already removed.
After a controller was hot-removed, if a reset sequence started to
the controller, spdk_nvme_ctrlr_disconnect() failed and caused core
dump in debug mode.

When implemented, how to cause the failure and how to process the
failure were not clear. Hence assert was added to detect the
failure.

We know how we cause the failure now. Let's handle the failure
appropriately.

If spdk_nvme_ctrlr_disconnect() fails, we are on the nvme_ctrlr->thread.
Hence call bdev_nvme_reset_complete() with failure immediately.

Even if spdk_nvme_ctrlr_disconnect() completes synchronously, the
completion callback is executed asynchronously when polling an adminq.

Hence set the completion callback only if spdk_nvme_ctrlr_disconnect()
succeeds.

Fixes issue #2632

Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: I11f61853aba9eca2515592f964a291e59def7247
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/13892
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2022-09-21 07:52:44 +00:00
..
accel accel: Do not refer to the "framework" as "engine" 2022-09-06 07:16:17 +00:00
app llvm: Using typecast for left shift value 2022-08-29 10:50:00 +00:00
bdev lib/nbd:export bdev flush and trim ability 2022-09-16 13:32:13 +00:00
blobfs check_format: For C files only, fix return type breaks 2022-06-27 09:33:48 +00:00
blobstore autotest_common.sh: change rpc_py to rpc_cmd 2022-09-01 11:15:03 +00:00
common nvme/rdma: Inline nvme_rdma_calloc/free 2022-09-20 20:27:52 +00:00
compress test/compress: change environment variable to "NET_TYPE=virt" in 2022-09-21 07:49:41 +00:00
cpp_headers Replace most BSD 3-clause license text with SPDX identifier. 2022-06-09 07:35:12 +00:00
dd test/dd: Simple tests utilizing uring RPCs 2021-12-20 08:46:13 +00:00
dma check_format: For C files only, fix return type breaks 2022-06-27 09:33:48 +00:00
dpdk_memory_utility autotest_common.sh: change rpc_py to rpc_cmd 2022-09-01 11:15:03 +00:00
env env_dpdk: add dpdk_pci_device_vtophys() 2022-09-20 10:19:22 +00:00
event check_format: For C files only, fix return type breaks 2022-06-27 09:33:48 +00:00
external_code configure/misc: make ISA-L a hard dependency 2022-09-20 10:18:54 +00:00
ftl ftl: Remove unnecessary bdev_nvme_detach_controller from test 2022-09-20 19:24:26 +00:00
fuzz configure/misc: make ISA-L a hard dependency 2022-09-20 10:18:54 +00:00
interrupt scripts: move python modules to python directory 2022-04-05 14:40:47 +00:00
ioat build: Example applications build to build/example 2020-06-15 15:27:16 +00:00
iscsi_tgt test: restore rpc_py to point to rpc.py instead of rpc_cmd 2022-09-06 18:01:42 +00:00
json_config bdev module: remove support for deprecated RPC names 2022-05-23 16:13:00 +00:00
lvol bdev module: remove support for deprecated RPC names 2022-05-23 16:13:00 +00:00
make event: make opts structures packed 2022-08-18 10:08:40 +00:00
nvme test/nvme: Counting io_submitted after starting I/O success 2022-09-20 10:19:39 +00:00
nvmf autotest: Move nvmf's fuzzing outside the main suite 2022-09-20 00:46:11 +00:00
ocf autotest_common.sh: change rpc_py to rpc_cmd 2022-09-01 11:15:03 +00:00
openstack run_openstack_tests.sh: move rpc_py declaration below source commands 2022-09-08 07:20:17 +00:00
pmem bdev module: remove support for deprecated RPC names 2022-05-23 16:13:00 +00:00
rpc scripts: move python modules to python directory 2022-04-05 14:40:47 +00:00
rpc_client check_format: For C files only, fix return type breaks 2022-06-27 09:33:48 +00:00
rpc_plugins autotest: Use rpc_cmd() for rpc plugin-based tests 2021-04-02 08:22:42 +00:00
scheduler perf/vhost: Add NUMA-aware cgroup setup for the VMs 2022-09-15 20:15:57 +00:00
setup test/setup: Remove the hp_status() test 2022-08-09 14:38:30 +00:00
sma test/sma: use smaller indention for the JSONs 2022-09-19 19:43:35 +00:00
spdkcli test/spdkcli: reduce amount of HUGEMEM memory requested 2022-09-19 13:11:06 +00:00
thread Replace most BSD 3-clause license text with SPDX identifier. 2022-06-09 07:35:12 +00:00
unit bdev/nvme: Fail reset sequence immediately if ctrlr is already removed. 2022-09-21 07:52:44 +00:00
vfio_user test/vfio-user: skip NVMeoF target coremask for VMs 2022-09-19 12:47:37 +00:00
vhost perf/vhost: Add NUMA-aware cgroup setup for the VMs 2022-09-15 20:15:57 +00:00
vmd vmd: rename enable_vmd RPC to vmd_enable 2022-09-01 08:48:32 +00:00
Makefile Replace most BSD 3-clause license text with SPDX identifier. 2022-06-09 07:35:12 +00:00
spdk_cunit.h Replace most BSD 3-clause license text with SPDX identifier. 2022-06-09 07:35:12 +00:00