[RFC,2/4] nvme: donot retry request for NVME_CTRL_DELETING_NOIO

Message ID 41041f049985675f95a38bdd8bb998c5a4ab140c.1685350577.git.chunguang.xu@shopee.com
State New
Headers
Series nvme-tcp: fix hung issues for deleting |

Commit Message

许春光 May 29, 2023, 10:59 a.m. UTC
  From: Chunguang Xu <chunguang.xu@shopee.com>

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@shopee.com>
---
 drivers/nvme/host/core.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
  

Patch

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;
 	}