Commit 78ca4b27 authored by Changpeng Liu's avatar Changpeng Liu
Browse files

nvmf: don't raise assertion when destroying an non-inactive subsystem



Sometimes VM may get a kernel panic when starting, and SPDK CI will kill
`nvmf_tgt` after 60 seconds, and for this exception, SPDK will raise an
assertion when destroying the subsystem, while here, we remove this
assertion and print the error information.

CI will still mark this case as a failed case, then we can use this error
information to understand error subsystem state in vfio-user.

Fix issue #2590.

Change-Id: I20b16f9e96a566730eca2dd9ea165645bd9160bd
Signed-off-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/13773


Community-CI: Mellanox Build Bot
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarDong Yi <dongx.yi@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
parent f5e5041d
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -420,8 +420,8 @@ spdk_nvmf_subsystem_destroy(struct spdk_nvmf_subsystem *subsystem, nvmf_subsyste
	assert(spdk_get_thread() == subsystem->thread);

	if (subsystem->state != SPDK_NVMF_SUBSYSTEM_INACTIVE) {
		SPDK_ERRLOG("Subsystem can only be destroyed in inactive state\n");
		assert(0);
		SPDK_ERRLOG("Subsystem can only be destroyed in inactive state, current state %d\n",
			    subsystem->state);
		return -EAGAIN;
	}
	if (subsystem->destroying) {
+2 −1
Original line number Diff line number Diff line
@@ -232,7 +232,8 @@ nvmf_tgt_subsystem_stopped(struct spdk_nvmf_subsystem *subsystem,
	if (subsystem) {
		rc = spdk_nvmf_subsystem_stop(subsystem, nvmf_tgt_subsystem_stopped, NULL);
		if (rc) {
			SPDK_ERRLOG("Unable to stop NVMe-oF subsystem. Trying others.\n");
			SPDK_ERRLOG("Unable to stop NVMe-oF subsystem %s with rc %d, Trying others.\n",
				    spdk_nvmf_subsystem_get_nqn(subsystem), rc);
			nvmf_tgt_subsystem_stopped(subsystem, NULL, 0);
		}
		return;