summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Garry <john.g.garry@oracle.com>2026-04-08 11:03:57 +0300
committerKeith Busch <kbusch@kernel.org>2026-04-09 17:20:39 +0300
commit7d435caacd91d23ebba281c4aac859196e1e2938 (patch)
tree2c2039c832ef4ba6ee75f2497d0b1d0252fd343a
parent7f991e3f9b8f044640bcb5fa8570350a68932843 (diff)
downloadlinux-7d435caacd91d23ebba281c4aac859196e1e2938.tar.xz
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: Christoph Hellwig <hch@lst.de> Signed-off-by: John Garry <john.g.garry@oracle.com> Signed-off-by: Keith Busch <kbusch@kernel.org>
-rw-r--r--drivers/nvme/host/multipath.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/drivers/nvme/host/multipath.c b/drivers/nvme/host/multipath.c
index ba00f0b72b85..263161cb8ac0 100644
--- a/drivers/nvme/host/multipath.c
+++ b/drivers/nvme/host/multipath.c
@@ -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;
}