Commit 7d435caa authored by John Garry's avatar John Garry Committed by Keith Busch
Browse files

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.

Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarJohn Garry <john.g.garry@oracle.com>
Signed-off-by: default avatarKeith Busch <kbusch@kernel.org>
parent 7f991e3f
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -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;
}