[PATCH 3/4] nvme-multipath: always requeue I/O when updating the ANA state

Hannes Reinecke hare at kernel.org
Fri Sep 6 00:18:27 PDT 2024


When we've changed the ANA state we always need to kiek the requeue
list to ensure any pending I/O is retried with the latest changes.

Signed-off-by: Hannes Reinecke <hare at kernel.org>
---
 drivers/nvme/host/multipath.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/nvme/host/multipath.c b/drivers/nvme/host/multipath.c
index f72c5a6a2d8e..143c9d64dfa7 100644
--- a/drivers/nvme/host/multipath.c
+++ b/drivers/nvme/host/multipath.c
@@ -734,9 +734,12 @@ static void nvme_update_ns_ana_state(struct nvme_ana_group_desc *desc,
 	 * will reprocess the ANA log page in nvme_mpath_update() once the
 	 * controller is ready.
 	 */
-	if (nvme_state_is_live(ns->ana_state) &&
-	    nvme_ctrl_state(ns->ctrl) == NVME_CTRL_LIVE)
-		nvme_mpath_set_live(ns);
+	if (nvme_ctrl_state(ns->ctrl) == NVME_CTRL_LIVE) {
+		if (nvme_state_is_live(ns->ana_state))
+			nvme_mpath_set_live(ns);
+		else
+			kblockd_schedule_work(&ns->head->requeue_work);
+	}
 }
 
 static int nvme_update_ana_state(struct nvme_ctrl *ctrl,
-- 
2.35.3




More information about the Linux-nvme mailing list