Skip to contentSkip to conversation

nvme-multipath: drop head pointer check in nvme_mpath_clear_current_path()

PATCH Applied John Garry 3 participants 3 messages Apr 8 – Apr 9 NVMe

lore
Share & tools
lore

John Garry

author
#0 lore raw

PATCH 1/1 nvme-multipath: drop head pointer check in nvme_mpath_clear_current_path()

A NS will always have a head pointer, so drop the check. As proof in practice, all the nvme_mpath_clear_current_path() callers also dereference ns->head.

This check has endured since the original changes to support multipath.

drivers/nvme/host/multipath.c +0 -4
index ba00f0b72b858..263161cb8ac06 100644
@@ -231,16 +231,12 @@ bool nvme_mpath_clear_current_path(struct nvme_ns *ns)
 	bool changed = false;
 	int node;
 
-	if (!head)
-		goto out;
-
 	for_each_node(node) {
 		if (ns == rcu_access_pointer(head->current_path[node])) {
 			rcu_assign_pointer(head->current_path[node], NULL);
 			changed = true;
 		}
 	}
-out:
 	return changed;
 }
 
Signature · 1 line
2.43.5
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · John Garry

A NS will always have a head pointer, so drop the check. As proof in practice, all the nvme_mpath_clear_current_path() callers also dereference ns->head.

This check has endured since the original changes to support multipath.

Looks good:

maintainer Applied
#2 lore raw
In reply to John Garry
Quoted 5 lines · John Garry

A NS will always have a head pointer, so drop the check. As proof in practice, all the nvme_mpath_clear_current_path() callers also dereference ns->head.

This check has endured since the original changes to support multipath.

Thanks, applied to nvme-7.1.