Skip to content

Commit

Permalink
nvme-multipath: Early exit if no path is available
Browse files Browse the repository at this point in the history
nvme_round_robin_path() should test if the return ns pointer is valid.
nvme_next_ns() will return a NULL pointer if there is no path left.

Fixes: 75c10e7 ("nvme-multipath: round-robin I/O policy")
Signed-off-by: Daniel Wagner <[email protected]>
Reviewed-by: Hannes Reinecke <[email protected]>
Signed-off-by: Christoph Hellwig <[email protected]>
  • Loading branch information
igaw authored and Christoph Hellwig committed Jan 28, 2021
1 parent 8991992 commit d1bcf00
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/nvme/host/multipath.c
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ static struct nvme_ns *nvme_round_robin_path(struct nvme_ns_head *head,
}

for (ns = nvme_next_ns(head, old);
ns != old;
ns && ns != old;
ns = nvme_next_ns(head, ns)) {
if (nvme_path_is_disabled(ns))
continue;
Expand Down

0 comments on commit d1bcf00

Please sign in to comment.