Thread (3 messages) 3 messages, 2 authors, 2021-08-11

Re: [PATCH v2] nvme: invalidate paths during rescan

From: Daniel Wagner <hidden>
Date: 2021-08-11 15:23:19

Hi Sagi,

On Tue, Aug 10, 2021 at 06:18:01PM -0700, Sagi Grimberg wrote:
quoted
+void nvme_mpath_invalidate_paths(struct nvme_ns *ns)
invalidate is not a great name for this very specific case here.
Okay, I opted for nvme_mpath_revalidate_paths() as we already have
nvme_revalidate_zones() which does also capacity checks too.
quoted
+{
+	struct nvme_ns_head *head = ns->head;
+	sector_t capacity = get_capacity(head->disk);
+	int node;
+
+	for_each_node(node)
+		rcu_assign_pointer(head->current_path[node], NULL);
Here the ns can get re-selected as the current path.
This is on purpose. By clearing all current_path the next
nvme_find_path() will select a valid current_path which might be the
same path.
quoted
+
+	list_for_each_entry_rcu(ns, &head->list, siblings) {
+		if (capacity != get_capacity(ns->disk))
+			set_bit(NVME_NS_INVALIDATED, &ns->flags);
maybe instead of invalidated reverse the polarity with
NVME_NS_READY? clear it here and set it in update_ns_info?
Will do, see next version.

Thanks for the feedback!

Daniel

_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help