Skip to content

Commit 04e70bd

Browse files
hreineckeChristoph Hellwig
authored andcommitted
nvme-multipath: do not select namespaces which are about to be removed
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 <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]>
1 parent 2032d07 commit 04e70bd

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/nvme/host/multipath.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,8 @@ void nvme_mpath_clear_current_path(struct nvme_ns *ns)
126126
static bool nvme_path_is_disabled(struct nvme_ns *ns)
127127
{
128128
return ns->ctrl->state != NVME_CTRL_LIVE ||
129-
test_bit(NVME_NS_ANA_PENDING, &ns->flags);
129+
test_bit(NVME_NS_ANA_PENDING, &ns->flags) ||
130+
test_bit(NVME_NS_REMOVING, &ns->flags);
130131
}
131132

132133
static struct nvme_ns *__nvme_find_path(struct nvme_ns_head *head, int node)

0 commit comments

Comments
 (0)