Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4672546pxj; Wed, 12 May 2021 10:33:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyzUDFB65nUTfvRxN2H0/QUbUAS0/Xm0cU6WIRDXNvpTXCUbKjBu4pv8tD3v+tR/lcaLhsC X-Received: by 2002:aca:654d:: with SMTP id j13mr8359803oiw.125.1620840802819; Wed, 12 May 2021 10:33:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620840802; cv=none; d=google.com; s=arc-20160816; b=xzMCnyulgdmbqLNQ4U+kUEUGstvG7iYpE9wyqfakvGruiO882O7A1vm6hAPED19UXq TM7e3PJn/6ce7axbuyTUNM6X5MvkR+Gmwf4NyD1LN2dSeFt1kb8KbEd4ycrO/GT0K+JR tVNNd7O5pj5PamfgucMg7ZBqmnCGb11fk7FD0bABV4Al6x2c0Ws7q634LJ7cdBN+Ris6 925VVfcHXS08lCTGziEVrLZ/0XrMhRYXpfl7kwB7VqEd+MmqiFL264KeinrWiwT12oDD 6KLz32bZWnEm2YuJe7I8M7kxjUxAsN0+zg1qIDAKFMBov+8PO8HpkKrdeiCGltTKDEkM oe/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=jEV1zA6+NkQxny0nVM3PWitk8L6E4LRftkYoiYS1/Rc=; b=Ec/Jpj3yF4C8AGtAJaX7dwe7j7g7o9kCQ29W23FmAOqIVI+b67v53h3Dweyna52HxH hyRYT1BpqMHdZM5jJqTiVTbRe3uO6ufbjrJnjXUOS4DUlKxBFHaFybyg+YedAGngrwy6 2usJ7WuKosrUljX9U8IiKBV22MuRRMvALYahu9hiGaXabYppta+VUJqvGc30roFxvG14 eik2yJzAq+AHqYVs7L4cEPy0IMiKoM4DsGTtVA46U/wDOzG+N6PQ3RK5k2j6Dvwk7J0D WNdUIrmzk6Mq1bDPOaZyjnZptn4YRL5WmkaInL4zn2ghBxNJ42luxG2zV6x7oK1rzMFm AXEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=x6OcciOV; 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=pass (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 z26si463783oth.181.2021.05.12.10.33.09; Wed, 12 May 2021 10:33:22 -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=@linuxfoundation.org header.s=korg header.b=x6OcciOV; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348141AbhELRbs (ORCPT + 99 others); Wed, 12 May 2021 13:31:48 -0400 Received: from mail.kernel.org ([198.145.29.99]:34302 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239494AbhELQIJ (ORCPT ); Wed, 12 May 2021 12:08:09 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id ED75C61D1F; Wed, 12 May 2021 15:38:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620833925; bh=SpGjjGVVe8JmAIMNrloQAi+f4SOqEGivqZfWIXbMlps=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=x6OcciOV2O/EJN3L4OWn+cX9Zr9SRwQC6QyT4lT9ZNoZ/dTGhSjZIIi7GQ22jxhXD m1hs6i19QfRWmhILwUZ3c0iWbT3Vrf+Www2xbR6DafVnM2HPFTpCoq7qXJ80sMRU+B iF2tPSWtdpmy/9UamofjY4LmLZC2gWJcVValDMO4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Martin George , Hannes Reinecke , Keith Busch , Sagi Grimberg , Christoph Hellwig , Sasha Levin Subject: [PATCH 5.11 344/601] nvme: retrigger ANA log update if group descriptor isnt found Date: Wed, 12 May 2021 16:47:01 +0200 Message-Id: <20210512144839.124549687@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210512144827.811958675@linuxfoundation.org> References: <20210512144827.811958675@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Hannes Reinecke [ Upstream commit dd8f7fa908f66dd44abcd83cbb50410524b9f8ef ] If ANA is enabled but no ANA group descriptor is found when creating a new namespace the ANA log is most likely out of date, so trigger a re-read. The namespace will be tagged with the NS_ANA_PENDING flag to exclude it from path selection until the ANA log has been re-read. Fixes: 32acab3181c7 ("nvme: implement multipath access to nvme subsystems") Reported-by: Martin George Signed-off-by: Hannes Reinecke Reviewed-by: Keith Busch Reviewed-by: Sagi Grimberg Signed-off-by: Christoph Hellwig Signed-off-by: Sasha Levin --- drivers/nvme/host/multipath.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/nvme/host/multipath.c b/drivers/nvme/host/multipath.c index fdfc18a222cc..c563efe0671e 100644 --- a/drivers/nvme/host/multipath.c +++ b/drivers/nvme/host/multipath.c @@ -668,6 +668,10 @@ void nvme_mpath_add_disk(struct nvme_ns *ns, struct nvme_id_ns *id) if (desc.state) { /* found the group desc: update */ nvme_update_ns_ana_state(&desc, ns); + } else { + /* group desc not found: trigger a re-read */ + set_bit(NVME_NS_ANA_PENDING, &ns->flags); + queue_work(nvme_wq, &ns->ctrl->ana_work); } } else { ns->ana_state = NVME_ANA_OPTIMIZED; -- 2.30.2