Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp533276pxb; Wed, 27 Jan 2021 14:08:55 -0800 (PST) X-Google-Smtp-Source: ABdhPJxvnF01IJIWZDzrQ/wl63dXMuce32ZBxSwlJpqiDQsx/aORE5BGzAf/Vv9gnKMNYUpYruZn X-Received: by 2002:a05:6402:22b7:: with SMTP id cx23mr11002377edb.313.1611785334936; Wed, 27 Jan 2021 14:08:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611785334; cv=none; d=google.com; s=arc-20160816; b=qdOla5OJZSwDROqbMTLyh7pECNR6pMvgC0F6CIA0ocDJZQ8flF2u8a1gsQMqBMZK1C HSGcbpHCTTEJTVfKQWe/Vda0GrgJNZ0fbUr3BB7WQfoQJNv66CJQbeK9CeK7gugbBrj1 B4VR3S4skLFvzSwiP6Pu1m+FKOXO6yoSGwMFwGvGljqKP3MTA4mzeTbvNlnH5+SpDoET 3j+E44DrbNAg79Y09ZUGmVihcLu8NPp7cJlGBQXZimr7W98UmEX9wuSmNH3dp6phEtQX qoXa6HQyzapuIOzQYFmBr8CNE0CwhvWFq35svXC8MzFLy4Jm0Arb2prexQiba3vFPCfw XD9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=QBkDYoxE+vSsY/eAOmvCFjgHjSEeYIRJebmmO8sSAG4=; b=tegOK393SJFhKP77V217othdbi8kCvthcijupipG2s7e6INolmCzZpqp+B1zU3yB/P p3XMhSrv2NYr3NHDxVw3BQBW9Z6kT0NqOf+f4MP7O78S9YL7SO3c/zFHlBLP3KkdV+hX XZxrV2cOyJZr6LfCNyi+jMr0Yk6noEo4IjbNsnQKt0OHcAw1PYW3CiqjxhrGWJ8ElEoh 9Y5RB78o4PBT9MxyzdbJa0V3K0tSk3TISBP7MpPDiBk+C5mJL956pLKnr0c94TKdc39d FoYVbWT8YNj3rcN0rWQ0M8hyhzdOaAaIyRCSTZAOZrbLqrtC6CRL0z0fS7gj6O/TMuWh dDeA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y14si1687076edt.2.2021.01.27.14.08.29; Wed, 27 Jan 2021 14:08:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235962AbhA0Kh0 (ORCPT + 99 others); Wed, 27 Jan 2021 05:37:26 -0500 Received: from mx2.suse.de ([195.135.220.15]:60750 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232831AbhA0KfT (ORCPT ); Wed, 27 Jan 2021 05:35:19 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 42B47ACBA; Wed, 27 Jan 2021 10:34:38 +0000 (UTC) Subject: Re: [PATCH v2] nvme-multipath: Early exit if no path is available To: Daniel Wagner , linux-nvme@lists.infradead.org Cc: linux-kernel@vger.kernel.org, Keith Busch , Jens Axboe , Christoph Hellwig , Sagi Grimberg References: <20210127103033.15318-1-dwagner@suse.de> From: Hannes Reinecke Message-ID: <1563c0d6-cb24-0861-5a4a-a5aabfab7f9d@suse.de> Date: Wed, 27 Jan 2021 11:34:37 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.1 MIME-Version: 1.0 In-Reply-To: <20210127103033.15318-1-dwagner@suse.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 1/27/21 11:30 AM, 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 > Signed-off-by: Daniel Wagner > --- > 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; > Reviewed-by: Hannes Reinecke Cheers, Hannes -- Dr. Hannes Reinecke Kernel Storage Architect hare@suse.de +49 911 74053 688 SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409 Nürnberg HRB 36809 (AG Nürnberg), Geschäftsführer: Felix Imendörffer