Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] nvme: retrigger ANA log update if group descriptor isn't found
@ 2020-12-05 15:29 Hannes Reinecke
  2020-12-07 15:31 ` Keith Busch
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Hannes Reinecke @ 2020-12-05 15:29 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: linux-nvme, Sagi Grimberg, Keith Busch, Hannes Reinecke

If ANA is enabled but no ANA group descriptor is found when creating
a new namespace the ANA log is most likely out of date, so trigger
a re-read. The namespace will be tagged with the NS_ANA_PENDING flag
to exclude it from path selection until the ANA log has been re-read.

Reported-by: Martin George <marting@netapp.com>
Signed-off-by: Hannes Reinecke <hare@suse.de>
---
 drivers/nvme/host/multipath.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/nvme/host/multipath.c b/drivers/nvme/host/multipath.c
index 74896be40c17..ee4a42dc99a0 100644
--- a/drivers/nvme/host/multipath.c
+++ b/drivers/nvme/host/multipath.c
@@ -667,6 +667,10 @@ void nvme_mpath_add_disk(struct nvme_ns *ns, struct nvme_id_ns *id)
 		if (desc.state) {
 			/* found the group desc: update */
 			nvme_update_ns_ana_state(&desc, ns);
+		} else {
+			/* group desc not found: trigger a re-read */
+			set_bit(NVME_NS_ANA_PENDING, &ns->flags);
+			queue_work(nvme_wq, &ns->ctrl->ana_work);
 		}
 	} else {
 		ns->ana_state = NVME_ANA_OPTIMIZED; 
-- 
2.26.2


_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2021-04-02 16:49 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-12-05 15:29 [PATCH] nvme: retrigger ANA log update if group descriptor isn't found Hannes Reinecke
2020-12-07 15:31 ` Keith Busch
2020-12-07 15:34   ` Christoph Hellwig
2020-12-07 15:46     ` Keith Busch
2020-12-08 14:03       ` Christoph Hellwig
2020-12-08 19:17         ` Keith Busch
2020-12-09  7:35           ` Christoph Hellwig
2020-12-07 15:51     ` Hannes Reinecke
2021-01-14  3:13 ` Sagi Grimberg
2021-03-25 10:55   ` George, Martin
2021-03-25 21:54     ` Keith Busch
2021-03-25 22:20       ` Sagi Grimberg
2021-04-02 16:49 ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox