Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2623200pxa; Mon, 17 Aug 2020 14:41:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyLbqiiUdIT8hgnCqeWZxwghL47YWTXv5+K2maIB8+91dge9YfdbO3nQXTc9tOAPF/jcAI+ X-Received: by 2002:a17:906:924b:: with SMTP id c11mr17724370ejx.75.1597700470841; Mon, 17 Aug 2020 14:41:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597700470; cv=none; d=google.com; s=arc-20160816; b=fOa3sMIaMQudSvIdrHrEnLu8Ltui4bQS4r2Q6aV+AV+r5iRlaMhQJLCdfQoLF0cQna wXSm8vFo+mK7lUcIDVIgYrXtMeAoRqrTW9tqMLVOKK2vH9rdKtq3eIuJ2JuUO92PfyK4 JnLMy9x288uD0VHBQAsUrdYd0ykqeATobtwjLFtcPzPZ4I/dKxBLGmUhEtThj7xev2Ya 4tRLymIaoL/tQS2DdCCVyzq9SIrnYglrOyJhs8UQPTKioaiGiWny1HyD2F8EANNW0thV EQdHvQlhZ0h0xRPZU5C1W8xFnLq3JJsvoTDBmqLt5rMmnUBoJ1z39d9NMMpZOY7SHRgR G8Kg== 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=q8aQ+762ay34YwTCyHH49p4yZyh4lvYHvYbVNh40DQU=; b=LKjFbX+i9Z010koBPIYj0Ep/7EHFspioHjOjkO/HFeTUozYlcxgSwsMf0YnS94HSoy bWR1lEIG0vquQ8jcrYXDobs9vsgL23p1S4tMP3I1P90Q6jqCHiztx/UcpK4TymxTb5wB 5s9nA4YXfZrYYfa5cp8a+RTZffN5YFdNf4HIMZ81hjMAcmZzElbY7Mb3FETvLI79PQak LLMpOA9/gwlwqSSZXVX/TnED0V9dTv5EK9/grp+lvflnev0boQk7ul0SrIEkffNflWDM 39h3I9GW2UTCWH09Iik1FJvwS8EGbOb/3663BmkAIiBrhuUDs2xBJzVMlXhp+GTFIPr5 7ICw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Yzd07W+k; 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 ox11si11778920ejb.727.2020.08.17.14.40.47; Mon, 17 Aug 2020 14:41:10 -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=Yzd07W+k; 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 S1729416AbgHQPWG (ORCPT + 99 others); Mon, 17 Aug 2020 11:22:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:43982 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729370AbgHQPVf (ORCPT ); Mon, 17 Aug 2020 11:21:35 -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 7FB25207DE; Mon, 17 Aug 2020 15:21:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597677695; bh=QDAW9zoveqrWFCuC7xBLGn80jtKBU8onUkR3R7/heiM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Yzd07W+k6lILrZJomE6sjrzszDs9RhFUbyzqM2DKb/rvX45QRjTdlhVxwUWgDeGIW EUR4o2OJJmAoElxn8P6xRFJxAPTjbeTxi4bgKep6n3217h8NJ556RzcwEUcqWLjkz0 Nrpp9jqGnK3kTd2+YFQhISgR16Ir+ITNnCh6P95U= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Martin Wilck , Hannes Reinecke , Sagi Grimberg , Christoph Hellwig , Sasha Levin Subject: [PATCH 5.8 074/464] nvme-multipath: do not fall back to __nvme_find_path() for non-optimized paths Date: Mon, 17 Aug 2020 17:10:27 +0200 Message-Id: <20200817143837.319138617@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: Hannes Reinecke [ Upstream commit fbd6a42d8932e172921c7de10468a2e12c34846b ] When nvme_round_robin_path() finds a valid namespace we should be using it; falling back to __nvme_find_path() for non-optimized paths will cause the result from nvme_round_robin_path() to be ignored for non-optimized paths. 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 | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/nvme/host/multipath.c b/drivers/nvme/host/multipath.c index fe8f7f123fac7..57d51148e71b6 100644 --- a/drivers/nvme/host/multipath.c +++ b/drivers/nvme/host/multipath.c @@ -272,10 +272,13 @@ inline struct nvme_ns *nvme_find_path(struct nvme_ns_head *head) struct nvme_ns *ns; ns = srcu_dereference(head->current_path[node], &head->srcu); - if (READ_ONCE(head->subsys->iopolicy) == NVME_IOPOLICY_RR && ns) - ns = nvme_round_robin_path(head, node, ns); - if (unlikely(!ns || !nvme_path_is_optimized(ns))) - ns = __nvme_find_path(head, node); + if (unlikely(!ns)) + return __nvme_find_path(head, node); + + if (READ_ONCE(head->subsys->iopolicy) == NVME_IOPOLICY_RR) + return nvme_round_robin_path(head, node, ns); + if (unlikely(!nvme_path_is_optimized(ns))) + return __nvme_find_path(head, node); return ns; } -- 2.25.1