]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
nvme-multipath: do not select namespaces which are about to be removed
authorHannes Reinecke <hare@suse.de>
Thu, 4 Jul 2019 06:10:47 +0000 (08:10 +0200)
committerChristoph Hellwig <hch@lst.de>
Tue, 9 Jul 2019 21:18:03 +0000 (14:18 -0700)
nvme_ns_remove() will first set the NVME_NS_REMOVING flag before removing
it from the list at the very last step.
So to avoid selecting a namespace in nvme_find_path() which is about to be
removed check the NVME_NS_REMOVING flag, too, when selecting a new path.

Signed-off-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/host/multipath.c

index 9b6dc11fa55963038bd8aa444b344658b520366a..a9a9276779708e2beca5497131cbfc547518e58e 100644 (file)
@@ -126,7 +126,8 @@ void nvme_mpath_clear_current_path(struct nvme_ns *ns)
 static bool nvme_path_is_disabled(struct nvme_ns *ns)
 {
        return ns->ctrl->state != NVME_CTRL_LIVE ||
-               test_bit(NVME_NS_ANA_PENDING, &ns->flags);
+               test_bit(NVME_NS_ANA_PENDING, &ns->flags) ||
+               test_bit(NVME_NS_REMOVING, &ns->flags);
 }
 
 static struct nvme_ns *__nvme_find_path(struct nvme_ns_head *head, int node)