nvme-multipath: Early exit if no path is available
PATCH 1/1 nvme-multipath: Early exit if no path is available
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.
--- drivers/nvme/host/multipath.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/nvme/host/multipath.c +2 -0
@@ -239,6 +239,8 @@ static struct nvme_ns *nvme_round_robin_path(struct nvme_ns_head *head,for (ns =nvme_next_ns (head, old); ns != old; ns =nvme_next_ns (head, ns)) { +if (!ns) +break ;if (nvme_path_is_disabled (ns))continue ;
Signature · 7 lines
2.29.2 _______________________________________________ Linux-nvme mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-nvme
Christoph Hellwig
maintainerQuoted 3 lines · Daniel Wagner
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.
How can that happen once we're in the loop?
_______________________________________________
Linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme
Quoted 1 line · Christoph Hellwig
How can that happen once we're in the loop?
As far I can tell, it's the first nvme_next_ns() call which returns the NULL pointer and this will pass the test 'ns != old'.
_______________________________________________
Linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme