From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 12C3CC433E0 for ; Sat, 8 Aug 2020 23:51:32 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D65F820672 for ; Sat, 8 Aug 2020 23:51:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="XXObA93q"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="BdGt5rKv" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D65F820672 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-nvme-bounces+linux-nvme=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=WFf1NhI5x36QhYjsNiXyMLBDgHACLsCEiGZFXyMM4kY=; b=XXObA93qZfc3ercY2/T0jEdYe Jh0frP8OvTfBH6iJTBZL2phYFcC392aMYyUOTWGGSTVGopHXBaylVNK5wQfvpSA6xgoySIq+9djg4 0sBCYG/StZy26R8ZhFEIl+vOKYMAV6oduNF0r4QaWXJCLJTotmOe6IMfpMpJdP2yygMUnpma8xKhC OwXcXWxbvJU4cC8a9rE272X6XwlhRHJWTeBJZYX5465V9GbRmh6kdSyN35vQsitx2vLpEcursvZK9 48a2iRk44bMjN6WtIc9egGhetbSp0mB3wxdQ+or07y7QbpgGylpr40fZ4Uz+uah0u7l/9+5DPOucd vXsw+M43Q==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1k4Yca-0004Dc-CU; Sat, 08 Aug 2020 23:51:28 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1k4YRA-0002YL-Jx for linux-nvme@lists.infradead.org; Sat, 08 Aug 2020 23:39:42 +0000 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 689D920829; Sat, 8 Aug 2020 23:39:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1596929979; bh=M7z37lMIBKjuXXT6srfcnRegDtH5UGdVUmG4jh/8MfU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BdGt5rKv7PKQnoggKyZzuHsYBxzEN92AQ3qi7WsQ3D5tbRcn4IUGqszn7Lqbi9NIu bR2XccA6aT2aagPU/l7hE1ko/n3EORHEZm4ptGLmZw7LjA3eMewOM2kJbRZopv199e 5NX+reykj8HS1OHE1Gn+j1NTA3LE3C08cN71fJaI= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: [PATCH AUTOSEL 5.4 39/40] nvme-multipath: fix logic for non-optimized paths Date: Sat, 8 Aug 2020 19:38:43 -0400 Message-Id: <20200808233844.3618823-39-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200808233844.3618823-1-sashal@kernel.org> References: <20200808233844.3618823-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200808_193940_817594_B9B10F55 X-CRM114-Status: GOOD ( 14.26 ) X-BeenThere: linux-nvme@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sasha Levin , Sagi Grimberg , linux-nvme@lists.infradead.org, Martin Wilck , Hannes Reinecke , Christoph Hellwig Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "Linux-nvme" Errors-To: linux-nvme-bounces+linux-nvme=archiver.kernel.org@lists.infradead.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 5433aa2f76017..38d25d7c6bca3 100644 --- a/drivers/nvme/host/multipath.c +++ b/drivers/nvme/host/multipath.c @@ -249,6 +249,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 _______________________________________________ Linux-nvme mailing list Linux-nvme@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-nvme