Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2658107pxa; Mon, 17 Aug 2020 15:44:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxITDpzUTiWPU5f7PWxNO4WvTXdtDWapeQBuiMPZdMkb8Kh0iS2TbXN4+4RbbyNgg5LUXsN X-Received: by 2002:aa7:d607:: with SMTP id c7mr16931565edr.184.1597704286434; Mon, 17 Aug 2020 15:44:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597704286; cv=none; d=google.com; s=arc-20160816; b=oN8LqQv2yyyj582WmbWgwMVzzq+7AYR+WpkIvdTWTbYpiSesLcSPH7q/L7TLe6G97J 1woy/CZfHPHkgWk5mLZTn+fFps4dNn4PaYg6dPwa7iNRRjnmZhF0LtKEndZr7d6f5xKS bou6uCw94tTpp/jnyqxwc5mVEcsWEKK77f2m58mUYBAlr/treVrch+/V7ZxnSqIsSDAD CmAGpCqUnnxMDHUldqWeRIY0bE3p0iBqB2O/F04GAtEtzAQrXdosLAb6l5ZKdV4GYqqE ZQznem+8SP4j73D60aojUyj1soAhvkJmZH5WfwbEnEEJTS65BfWAy87sh8SoyfdR4chx UAZg== 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=qn9ihdXK76zNKD+BpKkTk4NsPGBhm1mSvz6bWHjMfIA=; b=g3Nk9o8sgNHHgK+0M1SidaE2g42+TW9qOR7/wL0RGGkzqaVCwAV6ybxhplvcImqJ9z 0XFEyTjHxThPLI407XHEQKVG4YlcTJ8CVItLPI7cfBSc+u2kX3BzzKERXL6TZywtoAK3 7y/z9blo6+0cS78m9tCE1kwL2NCOTaYiZ9YTZ/rB90g/u+FnkXjTQoA3WIHEvrywOVUh 8LjNt/A4KJXZ/ACN50XnFl4nWslER6fs8ydpILG1cogiFKJfuR33c3+O8V9B6+gQmbwv upbH5MlPQG8axHfWmrrI3kVJNNc/wFX/rF8J56eiWq0+BkCVRwflDAuTSqFexQuSa8sE qhqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=RExdoTNj; 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 d23si11445793edp.84.2020.08.17.15.44.23; Mon, 17 Aug 2020 15:44:46 -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=RExdoTNj; 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 S1730563AbgHQTFz (ORCPT + 99 others); Mon, 17 Aug 2020 15:05:55 -0400 Received: from mail.kernel.org ([198.145.29.99]:55638 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387701AbgHQPoo (ORCPT ); Mon, 17 Aug 2020 11:44:44 -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 390DC22BF3; Mon, 17 Aug 2020 15:44:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597679083; bh=dAoe88Mtbo9LtHCsMieDiuSyR9ZBSp9hgxYb9HLpeHg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RExdoTNjmKAx4t09F5K1q9PcQ2JMaYYh1wXdyvZYXRK/0BwrD/cz6fWkeSrm7DUCA 6pTuqMWXgWnh1DvbWr+7erhGQTYQvl3VZsCZVOsZeE8wkRFk+/MO7liI6a/E/qtICi pQc+H6bclEhdqPkCbcebTUwlLFGslD/FnZmh6qJo= 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.7 060/393] nvme-multipath: fix logic for non-optimized paths Date: Mon, 17 Aug 2020 17:11:50 +0200 Message-Id: <20200817143822.533323614@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200817143819.579311991@linuxfoundation.org> References: <20200817143819.579311991@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 36db7d2e6a896..2c94e084a61b8 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