Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2664219pxa; Mon, 17 Aug 2020 15:57:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz63x+50nzQAN95dIUZAWrF2ANv708bIcbmTevQ5hHrKNrnThpEaa4vbYr2AMeWEwX234U/ X-Received: by 2002:a05:6402:c0a:: with SMTP id co10mr17651018edb.342.1597705023857; Mon, 17 Aug 2020 15:57:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597705023; cv=none; d=google.com; s=arc-20160816; b=kYoACe6fnH+FoxX7EycSHdCHqH/2ThTIxEwOKaScQ5OhHi0z0x6WbkkK2GMpd2ArB7 sJuK1u2oTCMJ3OO50m7mK2IQp8HU+z/AXzO34nGDVHiZYc8x3nE0mz4oLQp6/dUmkzMU H6cB/HPpIRIdTpojDJu1XZ0k7OITsgLmFKfCGJOvJKCEXxerHjtnPtvkrtzAwH+3sxe3 OPXCeuE1bw/AANBiZiwax0lR386cIaHgxIQwrdJR41MOdQt4IouPi3Ppvsl+t1t9yYqf cH3aL3AolLru4l3LPksGB8iU2nSYNIyWqUqzNCwq0QeoHNSKDEYRRjXI7RilohmCBDXp kang== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=iqk+6wC0NxBrgIJ06coEJcub4Rkg7h8iQxEViF8Ko1k=; b=MrR8R/gUaYm4sh0BM+JH2W67RB4L5yxIMyi7SJCMJxfQkkN8GybMNXpfvdMRhAF5vz aZdnlQKtDmfhfGK0cnLfMJJceSEzxuClu0R3jHpt3hQq45PhgyMlrxUC9m4G2wMo8LdD RAWHtEvo4nBl55jxdYuKwI4KTEYTrYSVsd3cW30CiwONhNbVsN7BuXErTeCsQtDyE4mt yowodBYrE22BZtAonw2za79rNRJzl5spziIy+IwEDjnYeETSgyN7Ro82izhYjrzSkVI6 EzQDsJ8hjjYn2FJnps00yczUWCmIX7e+nZMoTr73hFxTT5E7+hKoRRScQS9fhpEGcc7Z ZLgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=2l6P3Dpk; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cm21si11969672edb.111.2020.08.17.15.56.40; Mon, 17 Aug 2020 15:57:03 -0700 (PDT) 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; dkim=pass header.i=@kernel.org header.s=default header.b=2l6P3Dpk; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729587AbgHQTqO (ORCPT + 99 others); Mon, 17 Aug 2020 15:46:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:43914 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729360AbgHQPVc (ORCPT ); Mon, 17 Aug 2020 11:21:32 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1E62F207D3; Mon, 17 Aug 2020 15:21:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597677692; bh=gWkKBLqrFyWOSdK7if2G2dxRkh8/ELMIAsFk2X3V7AE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2l6P3DpknOknM90+KPhTNTysoWeXi6ohLiXLG/aaBs9z2HB4Afp1AS6TkGAjNcpzJ KV+DVeVcu1rPU/kjTAV/gQvi2mTi88wOlEIj5U4j9WAVb/icTt1mWbd6Y3DB7rKL+t /tlBlA6axk6bRf0PErglntRe1AOu9HyHh439tPiI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hannes Reinecke , Sagi Grimberg , Christoph Hellwig , Sasha Levin Subject: [PATCH 5.8 073/464] nvme-multipath: fix logic for non-optimized paths Date: Mon, 17 Aug 2020 17:10:26 +0200 Message-Id: <20200817143837.268973244@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200817143833.737102804@linuxfoundation.org> References: <20200817143833.737102804@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Martin Wilck [ Upstream commit 3f6e3246db0e6f92e784965d9d0edb8abe6c6b74 ] Handle the special case where we have exactly one optimized path, which we should keep using in this case. Fixes: 75c10e732724 ("nvme-multipath: round-robin I/O policy") Signed off-by: Martin Wilck Signed-off-by: Hannes Reinecke Reviewed-by: Sagi Grimberg Signed-off-by: Christoph Hellwig Signed-off-by: Sasha Levin --- drivers/nvme/host/multipath.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/nvme/host/multipath.c b/drivers/nvme/host/multipath.c index 66509472fe06a..fe8f7f123fac7 100644 --- a/drivers/nvme/host/multipath.c +++ b/drivers/nvme/host/multipath.c @@ -246,6 +246,12 @@ static struct nvme_ns *nvme_round_robin_path(struct nvme_ns_head *head, fallback = ns; } + /* No optimized path found, re-check the current path */ + if (!nvme_path_is_disabled(old) && + old->ana_state == NVME_ANA_OPTIMIZED) { + found = old; + goto out; + } if (!fallback) return NULL; found = fallback; -- 2.25.1