[RFC PATCH 3/4] nvme: optimize nvme_check_ready() for NVME_CTRL_DELETING_NOIO

brookxu.cn brookxu.cn at gmail.com
Mon May 29 03:59:25 PDT 2023


From: Chunguang Xu <chunguang.xu at shopee.com>

nvme_check_ready() will directly return queue_alive while
controller is NVME_CTRL_DELETING, maybe we should do the
same things for NVME_CTRL_DELETING_NOIO.

Signed-off-by: Chunguang Xu <chunguang.xu at shopee.com>
---
 drivers/nvme/host/nvme.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/nvme/host/nvme.h b/drivers/nvme/host/nvme.h
index a2d4f59e0535..35066ad10cd9 100644
--- a/drivers/nvme/host/nvme.h
+++ b/drivers/nvme/host/nvme.h
@@ -793,7 +793,8 @@ static inline bool nvme_check_ready(struct nvme_ctrl *ctrl, struct request *rq,
 	if (likely(ctrl->state == NVME_CTRL_LIVE))
 		return true;
 	if (ctrl->ops->flags & NVME_F_FABRICS &&
-	    ctrl->state == NVME_CTRL_DELETING)
+	    (ctrl->state == NVME_CTRL_DELETING ||
+	     ctrl->state == NVME_CTRL_DELETING_NOIO))
 		return queue_live;
 	return __nvme_check_ready(ctrl, rq, queue_live);
 }
-- 
2.25.1




More information about the Linux-nvme mailing list