[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ca8be10a-11fb-dd4d-3606-f9e75a42c99d@huawei.com>
Date: Thu, 28 Jan 2021 09:36:14 +0800
From: Chao Leng <lengchao@...wei.com>
To: Daniel Wagner <dwagner@...e.de>, <linux-nvme@...ts.infradead.org>
CC: Sagi Grimberg <sagi@...mberg.me>, <linux-kernel@...r.kernel.org>,
"Jens Axboe" <axboe@...com>, Hannes Reinecke <hare@...e.de>,
Keith Busch <kbusch@...nel.org>, Christoph Hellwig <hch@....de>
Subject: Re: [PATCH v2] nvme-multipath: Early exit if no path is available
On 2021/1/27 18:30, Daniel Wagner wrote:
> 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@...e.de>
> Signed-off-by: Daniel Wagner <dwagner@...e.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;
nvme_round_robin_path just be called when !"old".
nvme_next_ns should not return NULL when !"old".
It seems unnecessary to add checking "ns".
Is there a bug that "old" is not in "head" list?
If yes, we should fix it.
> ns = nvme_next_ns(head, ns)) {
> if (nvme_path_is_disabled(ns))
> continue;
>
Powered by blists - more mailing lists