From: Hannes Reinecke <hare@suse.de>
Date: Wed, 23 Aug 2023 13:44:18 +0200
Subject: nvme-tcp: Do not terminate commands when in RESETTING
Patch-mainline: Not yet, TP is not yet released
References: bsc#1201284
When the error recovery started it will terminate all commands
anyway, so we should just return BLK_EH_RESET_TIMER for a
command timeout.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Acked-by: Daniel Wagner <dwagner@suse.de>
---
drivers/nvme/host/tcp.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/nvme/host/tcp.c b/drivers/nvme/host/tcp.c
index cf887e29dba7..5c7bfc74a440 100644
--- a/drivers/nvme/host/tcp.c
+++ b/drivers/nvme/host/tcp.c
@@ -2336,6 +2336,14 @@ nvme_tcp_timeout(struct request *rq, bool reserved)
"queue %d: timeout request %#x type %d\n",
nvme_tcp_queue_id(req->queue), rq->tag, pdu->hdr.type);
+ /*
+ * If the error recovery is started all commands will be
+ * aborted anyway, and nothing is to be done here.
+ */
+ if (ctrl->state == NVME_CTRL_RESETTING &&
+ work_pending(&to_tcp_ctrl(ctrl)->err_work))
+ return BLK_EH_RESET_TIMER;
+
if (ctrl->state != NVME_CTRL_LIVE) {
/*
* If we are resetting, connecting or deleting we should
--
2.35.3