numam-spdk/lib
Shuhei Matsumoto 974c70e63f lib/nvme: nvme_ctrlr_fail() return immediately if ctrlr is already failed
As log shows

00:06:32.300  [2020-12-18 21:13:35.511014] nvme_ctrlr.c:1414:spdk_nvme_ctrlr_reset: *ERROR*: Controller reinitialization failed.
00:06:32.300  [2020-12-18 21:13:35.511104] nvme_ctrlr.c: 925:nvme_ctrlr_fail: *ERROR*: ctrlr 192.168.100.8 in failed state.
00:06:32.300  [2020-12-18 21:13:35.511132] bdev_nvme.c: 392:_bdev_nvme_reset_complete: *ERROR*: Resetting controller failed.
00:06:32.300  [2020-12-18 21:13:35.511240] nvme_ctrlr.c: 925:nvme_ctrlr_fail: *ERROR*: ctrlr 192.168.100.8 in failed state.
00:06:32.300  [2020-12-18 21:13:35.511511] bdev_nvme.c: 556:bdev_nvme_failover: *NOTICE*: Unable to perform reset, already in progress.

if spdk_nvme_ctrlr_reset() failed, nvme_ctrlr_fail() is called, and
then if spdk_nvme_ctrlr_process_admin_completions() failed,
nvme_ctrlr_fail() is called.

We don't know which one comes first but nvme_ctrlr_fail() should do
nothing if the ctrlr is already failed.

Hence we should avoid setting ctrlr->is_failed and calling
nvme_transport_ctrlr_disconnect_qpair() twice.

However we should set ctrlr->is_removed if the parameter hot_remove is true.

We do these changes in this patch.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Iac37c892e054fb59d78e69346ca7f0575d596235
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5694
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2020-12-28 13:28:11 +00:00
..
accel lib/accel: change max batch size to match idxd batch max 2020-11-18 11:27:23 +00:00
bdev bdev: Solve the ABI compatibility issue related with spdk_bdev_opts 2020-12-18 09:48:45 +00:00
blob blob: add more detail to bs_load_use_pages_cpl assert 2020-12-14 14:29:09 +00:00
blobfs lib/blobfs: remove legacy config support 2020-10-20 02:42:16 +00:00
conf lib/conf: check pointer return value when use calloc 2020-11-11 01:02:31 +00:00
env_dpdk lib/env: move minimum DPDK version to DPDK 19.11 2020-12-04 09:51:00 +00:00
env_ocf lib/thead: print error log when create mempool or ring failed 2020-11-05 09:41:06 +00:00
event lib/event: support ABI compatibility for spdk_app_opts. 2020-12-16 08:40:14 +00:00
ftl lib/ftl: add assert check for ftl_wptr_from_band 2020-11-17 08:25:31 +00:00
idxd lib/idxd: small code cleanup 2020-10-22 22:43:28 +00:00
ioat ioat: hide 2MiB boundary memory check in spdk_vtophys() 2020-11-25 17:15:13 +00:00
iscsi iscsi: get the member after the NULL check 2020-12-01 10:21:50 +00:00
json json: add spdk_json_free_object() 2020-10-19 10:02:10 +00:00
jsonrpc lib/jsonrpc: Add a new API to send response for writing bool result. 2020-11-16 15:08:47 +00:00
log log: remove internal log.h header 2020-10-15 08:23:39 +00:00
lvol bdev: extend interface with get module ctx 2020-12-01 10:20:56 +00:00
nbd nbd/nbd_rpc: Fix memory leak of an error path. 2020-12-21 17:49:16 +00:00
net lib/jsonrpc: Add a new API to send response for writing bool result. 2020-11-16 15:08:47 +00:00
notify log: remove internal log.h header 2020-10-15 08:23:39 +00:00
nvme lib/nvme: nvme_ctrlr_fail() return immediately if ctrlr is already failed 2020-12-28 13:28:11 +00:00
nvmf nvmf/tcp: Remove tcp qpair::send_queue 2020-12-18 09:48:55 +00:00
rdma rdma: Don't log rdma_disconnect error for iWARP in verbs provider 2020-12-01 10:21:03 +00:00
reduce log: remove internal log.h header 2020-10-15 08:23:39 +00:00
rocksdb build: use DEPDIRS variables to build SPDK_LIB_LIST 2020-12-18 09:40:01 +00:00
rpc RPC: update the error message for current RPC state 2020-07-31 08:21:37 +00:00
scsi lib: Use PRId64 for portability 2020-11-20 11:01:37 +00:00
sock lib/sock: Make spdk_sock_flush do real work if sock does not belong to a group. 2020-12-18 09:39:51 +00:00
thread intr: allow operations on fd=0 2020-12-21 17:49:12 +00:00
trace trace: disable trace by set num-trace-entries=0 2020-11-26 10:16:26 +00:00
ut_mock mk/lib: add a check that major and minor version is set for libs. 2020-05-21 09:19:00 +00:00
util intr: allow operations on fd=0 2020-12-21 17:49:12 +00:00
vhost vhost-blk: process VIRTIO_BLK_WRITE_ZEROES_FLAG_UNMAP correctly 2020-12-28 13:17:00 +00:00
virtio virtio: add transitional virtio device support 2020-11-20 11:00:53 +00:00
vmd lib: Use PRId64 for portability 2020-11-20 11:01:37 +00:00
Makefile vhost: deprecate internal vhost library support 2020-10-20 02:42:16 +00:00