All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] nvme-multipath: Early exit if no path is available
@ 2021-01-27 10:30 ` Daniel Wagner
  0 siblings, 0 replies; 50+ messages in thread
From: Daniel Wagner @ 2021-01-27 10:30 UTC (permalink / raw)
  To: linux-nvme
  Cc: linux-kernel, Keith Busch, Jens Axboe, Christoph Hellwig,
	Sagi Grimberg, Daniel Wagner, Hannes Reinecke

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: 75c10e732724 ("nvme-multipath: round-robin I/O policy")
Cc: Hannes Reinecke <hare@suse.de>
Signed-off-by: Daniel Wagner <dwagner@suse.de>
---
v2:
  - moved NULL test into the if conditional statement
  - added Fixes tag

 drivers/nvme/host/multipath.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/nvme/host/multipath.c b/drivers/nvme/host/multipath.c
index 9ac762b28811..282b7a4ea9a9 100644
--- a/drivers/nvme/host/multipath.c
+++ b/drivers/nvme/host/multipath.c
@@ -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;
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 50+ messages in thread

end of thread, other threads:[~2021-02-02  1:13 UTC | newest]

Thread overview: 50+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-27 10:30 [PATCH v2] nvme-multipath: Early exit if no path is available Daniel Wagner
2021-01-27 10:30 ` Daniel Wagner
2021-01-27 10:34 ` Hannes Reinecke
2021-01-27 10:34   ` Hannes Reinecke
2021-01-27 16:49 ` Christoph Hellwig
2021-01-27 16:49   ` Christoph Hellwig
2021-01-28  1:31 ` Chao Leng
2021-01-28  1:31   ` Chao Leng
2021-01-28  7:58   ` Daniel Wagner
2021-01-28  7:58     ` Daniel Wagner
2021-01-28  9:18     ` Chao Leng
2021-01-28  9:18       ` Chao Leng
2021-01-28  9:23       ` Hannes Reinecke
2021-01-28  9:23         ` Hannes Reinecke
2021-01-29  1:18         ` Chao Leng
2021-01-29  1:18           ` Chao Leng
2021-01-28  9:40       ` Daniel Wagner
2021-01-28  9:40         ` Daniel Wagner
2021-01-29  1:23         ` Chao Leng
2021-01-29  1:23           ` Chao Leng
2021-01-29  1:42           ` Sagi Grimberg
2021-01-29  1:42             ` Sagi Grimberg
2021-01-29  3:07             ` Chao Leng
2021-01-29  3:07               ` Chao Leng
2021-01-29  3:30               ` Sagi Grimberg
2021-01-29  3:30                 ` Sagi Grimberg
2021-01-29  3:36                 ` Chao Leng
2021-01-29  3:36                   ` Chao Leng
2021-01-29  7:06               ` Hannes Reinecke
2021-01-29  7:06                 ` Hannes Reinecke
2021-01-29  7:45                 ` Chao Leng
2021-01-29  8:33                   ` Hannes Reinecke
2021-01-29  8:46                     ` Chao Leng
2021-01-29  9:20                       ` Hannes Reinecke
2021-02-01  2:16                         ` Chao Leng
2021-02-01  2:16                           ` Chao Leng
2021-02-01  7:29                           ` Hannes Reinecke
2021-02-01  7:29                             ` Hannes Reinecke
2021-02-01  8:47                             ` Chao Leng
2021-02-01  8:47                               ` Chao Leng
2021-02-01  8:57                               ` Hannes Reinecke
2021-02-01  8:57                                 ` Hannes Reinecke
2021-02-01  9:40                                 ` Chao Leng
2021-02-01  9:40                                   ` Chao Leng
2021-02-01 10:45                                   ` Hannes Reinecke
2021-02-01 10:45                                     ` Hannes Reinecke
2021-02-02  1:12                                     ` Chao Leng
2021-02-02  1:12                                       ` Chao Leng
2021-01-28  1:36 ` Chao Leng
2021-01-28  1:36   ` Chao Leng

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.