]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
nvme-multipath: pass NS head to nvme_mpath_revalidate_paths()
authorJohn Garry <john.g.garry@oracle.com>
Fri, 29 May 2026 09:52:01 +0000 (09:52 +0000)
committerKeith Busch <kbusch@kernel.org>
Tue, 2 Jun 2026 10:15:08 +0000 (03:15 -0700)
In nvme_mpath_revalidate_paths(), we are passed a NS pointer and use that
to lookup the NS head and then use that same NS pointer as an iter variable.

It makes more sense pass the NS head and use a local variable for the NS
iter.

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/core.c
drivers/nvme/host/multipath.c
drivers/nvme/host/nvme.h

index 5d8af8aa472e6db220c5af4e7811cad53654d2e6..f69e3115d8cf9fe8ef1eaae35850dd6163399bd1 100644 (file)
@@ -2567,7 +2567,7 @@ static int nvme_update_ns_info(struct nvme_ns *ns, struct nvme_ns_info *info)
 
                set_capacity_and_notify(ns->head->disk, get_capacity(ns->disk));
                set_disk_ro(ns->head->disk, nvme_ns_is_readonly(ns, info));
-               nvme_mpath_revalidate_paths(ns);
+               nvme_mpath_revalidate_paths(ns->head);
 
                blk_mq_unfreeze_queue(ns->head->disk->queue, memflags);
        }
index 263161cb8ac06cf08c5af31573d824eae1cf91d9..e00e2842df307094c84a44811e4f54f73ec9dd4f 100644 (file)
@@ -254,10 +254,10 @@ void nvme_mpath_clear_ctrl_paths(struct nvme_ctrl *ctrl)
        srcu_read_unlock(&ctrl->srcu, srcu_idx);
 }
 
-void nvme_mpath_revalidate_paths(struct nvme_ns *ns)
+void nvme_mpath_revalidate_paths(struct nvme_ns_head *head)
 {
-       struct nvme_ns_head *head = ns->head;
        sector_t capacity = get_capacity(head->disk);
+       struct nvme_ns *ns;
        int node;
        int srcu_idx;
 
index 9ccaed0b9dbf1967fc591e01f927acb46af95c2a..86b09c06b9e0a19d30cc22ea8662f9997a858611 100644 (file)
@@ -1043,7 +1043,7 @@ void nvme_mpath_update(struct nvme_ctrl *ctrl);
 void nvme_mpath_uninit(struct nvme_ctrl *ctrl);
 void nvme_mpath_stop(struct nvme_ctrl *ctrl);
 bool nvme_mpath_clear_current_path(struct nvme_ns *ns);
-void nvme_mpath_revalidate_paths(struct nvme_ns *ns);
+void nvme_mpath_revalidate_paths(struct nvme_ns_head *head);
 void nvme_mpath_clear_ctrl_paths(struct nvme_ctrl *ctrl);
 void nvme_mpath_remove_disk(struct nvme_ns_head *head);
 void nvme_mpath_start_request(struct request *rq);
@@ -1108,7 +1108,7 @@ static inline bool nvme_mpath_clear_current_path(struct nvme_ns *ns)
 {
        return false;
 }
-static inline void nvme_mpath_revalidate_paths(struct nvme_ns *ns)
+static inline void nvme_mpath_revalidate_paths(struct nvme_ns_head *head)
 {
 }
 static inline void nvme_mpath_clear_ctrl_paths(struct nvme_ctrl *ctrl)