[RFC PATCH 2/4] nvme: donot retry request for NVME_CTRL_DELETING_NOIO
From: brookxu.cn
Date: Mon May 29 2023 - 06:59:49 EST
From: Chunguang Xu <chunguang.xu@xxxxxxxxxx>
According to NVME_CTRL_DELETING_NOIO definition, we should
not requeue any request while controller at this state.
Signed-off-by: Chunguang Xu <chunguang.xu@xxxxxxxxxx>
---
drivers/nvme/host/core.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index 1f0cbb77b249..304eb4eda6c4 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -346,6 +346,8 @@ enum nvme_disposition {
static inline enum nvme_disposition nvme_decide_disposition(struct request *req)
{
+ struct nvme_ctrl *ctrl = nvme_req(req)->ctrl;
+
if (likely(nvme_req(req)->status == 0))
return COMPLETE;
@@ -362,7 +364,8 @@ static inline enum nvme_disposition nvme_decide_disposition(struct request *req)
blk_queue_dying(req->q))
return FAILOVER;
} else {
- if (blk_queue_dying(req->q))
+ if (ctrl->state == NVME_CTRL_DELETING_NOIO ||
+ blk_queue_dying(req->q))
return COMPLETE;
}
--
2.25.1