]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
nvme-multipath: drop head pointer check in nvme_mpath_clear_current_path()
authorJohn Garry <john.g.garry@oracle.com>
Wed, 8 Apr 2026 08:03:57 +0000 (08:03 +0000)
committerKeith Busch <kbusch@kernel.org>
Thu, 9 Apr 2026 14:20:39 +0000 (07:20 -0700)
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>
drivers/nvme/host/multipath.c

index ba00f0b72b858cbc2760db45c4996d967564bb15..263161cb8ac06cf08c5af31573d824eae1cf91d9 100644 (file)
@@ -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;
 }