[PATCH] nvme: wait request queue freeze long enough

Hillf Danton hdanton at sina.com
Sat Sep 5 00:27:20 EDT 2020


Apply the input timeout to every queue in order to avoid false positive.

Fixes: 302ad8cc0933 ("nvme: Complete all stuck requests")
Cc: Keith Busch <kbusch at kernel.org>
Cc: Sagi Grimberg <sagi at grimberg.me>
Cc: Christoph Hellwig <hch at lst.de>
Signed-off-by: Hillf Danton <hdanton at sina.com>
---

--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -4570,15 +4570,16 @@ EXPORT_SYMBOL_GPL(nvme_unfreeze);
 int nvme_wait_freeze_timeout(struct nvme_ctrl *ctrl, long timeout)
 {
 	struct nvme_ns *ns;
+	long ret;
 
 	down_read(&ctrl->namespaces_rwsem);
 	list_for_each_entry(ns, &ctrl->namespaces, list) {
-		timeout = blk_mq_freeze_queue_wait_timeout(ns->queue, timeout);
-		if (timeout <= 0)
+		ret = blk_mq_freeze_queue_wait_timeout(ns->queue, timeout);
+		if (!ret)
 			break;
 	}
 	up_read(&ctrl->namespaces_rwsem);
-	return timeout;
+	return ret;
 }
 EXPORT_SYMBOL_GPL(nvme_wait_freeze_timeout);
 
--




More information about the Linux-nvme mailing list