Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2637116pxa; Mon, 17 Aug 2020 15:06:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxRF88Qi2SjueSZWj10oeiydOJPH6RDrVxri07S7kR/1ijNzrVMJYXU80DW6GLvAjlQDC/S X-Received: by 2002:a50:99cf:: with SMTP id n15mr16386410edb.352.1597702015685; Mon, 17 Aug 2020 15:06:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597702015; cv=none; d=google.com; s=arc-20160816; b=neXDJDCndp6HQq/RWF9K9269zrm5FzK9gzKYPLZCb+nLenJ28V7zXbtP5MN9HewhLP hYYoBc638RrdfNZ+GuWKWAK5A53YwhUQMfBzXkAIzp4Vs1LDNEBaw3ZrcIQj4YNLOEgy r+vw721thskjYq/f7pJpneBnPA3JX+lADN6kdnxg/WwkwSRveaR4C58Jws6NpSrRDSHx ESaFsh9MMTN4+FuWThFhiHf02HsBbSEm6gz54+3YIm2BHIzvu3OaYNxTqbo4rlW6FVPV lERVSLJjEo0yPy48IN0KS6KAQ94NQDCuTsetlcv479ujjHtBsdVArt9LCMJS19/rjWi6 21xA== 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=xvAIiUzaW5hQuAR25UPYj58BiS9GQPyJVd+DBBoq+3U=; b=Ov1+kcZXKZWNOtM4Jv4KReRlAVWGSSY01ZiXab7OSkdIT1JTh+CEF6TbxSdrpc/wG+ w+VvFJxzZyy3MMtusj3qGi8JKAAk10hwGEfs9WfskoQaQ1y4HSN2C28aAf2DIglpCGqk i5SKW0cvQfXbNUxTv4sz5T70WDJxY69W99v5pOQ5zBz58siLEFflaWcBQ380iLXSjJ9J XddU9zPy1PR0G3iNDDAiaiQV1Jf34179ryQVurGtHUbgDbXyNeXy2lFExHowS9cDT7Su +kM8E3sSzFH6iYp5+QgWcmu2HFEuOrt5c1Jwlb/mT6JezwH0I10DejHuhCGqIyOuLeco +Z8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Z2PkxWjA; 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 dn2si12182289edb.378.2020.08.17.15.06.32; Mon, 17 Aug 2020 15:06:55 -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=Z2PkxWjA; 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 S2388317AbgHQQEc (ORCPT + 99 others); Mon, 17 Aug 2020 12:04:32 -0400 Received: from mail.kernel.org ([198.145.29.99]:55702 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387702AbgHQPor (ORCPT ); Mon, 17 Aug 2020 11:44:47 -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 2CEF52075B; Mon, 17 Aug 2020 15:44:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597679086; bh=L07yy2GmUsjLM3+nAixezYsG4RZHhf9+qZPnLqSltYw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Z2PkxWjAVPWdPLSkTxRkXvuOmE73019tXhWWfP80sSdOReLRrQW0IJMrk85+czJqG p/q0kdRdRE0DvQsk77jOBwv3FU0E3Jumw2fKcFql9yEye4TqMUQc2QdiPYQg8NcX9M Q5PwVWeYkFqJzeRi7Yt3sJ0VMddHIZC+NuBVuX8c= 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.7 061/393] nvme-multipath: do not fall back to __nvme_find_path() for non-optimized paths Date: Mon, 17 Aug 2020 17:11:51 +0200 Message-Id: <20200817143822.581326375@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: 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 2c94e084a61b8..d3914b7e8f52c 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