From 3dc3f4164b8ec05659c0aa57ff7afc1479832589 Mon Sep 17 00:00:00 2001 From: Ziye Yang Date: Thu, 10 Jan 2019 18:26:58 +0800 Subject: [PATCH] nvmf: Update the subsystem state check during connect Observed some issues related with AER in the testpool, which states that the subsystem is not ready. So change the check, which will be more accurate. We only did not allow the subsystem in inactive state or deactivitating state. For others, we can still queue the requests. Change-Id: Ic041298dfc5f7d7bfab5f5e5314ade377273df32 Signed-off-by: Ziye Yang Reviewed-on: https://review.gerrithub.io/c/439797 Tested-by: SPDK CI Jenkins Reviewed-by: Ben Walker Reviewed-by: Jim Harris Reviewed-by: Shuhei Matsumoto Reviewed-by: Seth Howell Reviewed-by: Changpeng Liu --- lib/nvmf/ctrlr.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/nvmf/ctrlr.c b/lib/nvmf/ctrlr.c index c5876ff225..a62f54f3dc 100644 --- a/lib/nvmf/ctrlr.c +++ b/lib/nvmf/ctrlr.c @@ -358,7 +358,8 @@ spdk_nvmf_ctrlr_connect(struct spdk_nvmf_request *req) return SPDK_NVMF_REQUEST_EXEC_STATUS_COMPLETE; } - if (subsystem->state != SPDK_NVMF_SUBSYSTEM_ACTIVE) { + if ((subsystem->state == SPDK_NVMF_SUBSYSTEM_INACTIVE) || + (subsystem->state == SPDK_NVMF_SUBSYSTEM_DEACTIVATING)) { SPDK_ERRLOG("Subsystem '%s' is not ready\n", subnqn); rsp->status.sct = SPDK_NVME_SCT_COMMAND_SPECIFIC; rsp->status.sc = SPDK_NVMF_FABRIC_SC_CONTROLLER_BUSY;