Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp342807pxj; Thu, 20 May 2021 10:33:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxmfvuz/arm8nb3F6h8K/qgOQgZfqvSSr7ZajtMIy1OI5gdTQcGB7ZZvBZ2IRY2uCvSRuIj X-Received: by 2002:a17:907:72c3:: with SMTP id du3mr5894003ejc.194.1621532019464; Thu, 20 May 2021 10:33:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621532019; cv=none; d=google.com; s=arc-20160816; b=BlCpHBnPJTw2Hk1fJnuldZ628HiziCfBHUNp+B0Ph7Jv9klcxfgqTMim4k5h+/OsoO ypQLzPSPuSyKi6WkPGS6bH3u8tlgu1s+9B4wB8hN9Zyj1wzoPWHPXGmxgDnY4BmO5B5G NPPZ9clfP3PzlzytfQwTto7ihrpsq7cCWyjYxYiTws2AXm4LeGf/orwHVU3Ji/tFjAF6 rjpKhmCtzg8isg41vEnluB17n3sfos57zAd9SQscnFswW5HPF+wd3AY1jWqA3xQ3NaNB x1wK0NV6u3DcKXQLeEPFwOFEavI8pn3b7fR1+Uzyb+DxAfaaGemMLx20yNjwURrQp8sh VA+w== 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=HeDzGRH1/chdMWB233njLGnvSSmkEsPSc7jZANnuf0o=; b=M3orPBnsXHXVDkXUmIgbAaItlfNDRvgiJHGGZ83xY96JvzQ8vIA794FJi+bTfsWISR kPornZK4h94lwv5RJOi9c9OBvT2/QusPubUBTXTEaH+Cm0/VvauKvnr57y8MGkou8mgI vIQdHMVd4dOgtfxocDgknnjWT2iV3GBLJbD7pwztxs3AvgLmu5z6Zu6b1PLdBtEx2Mpi dVDXmjEa3efBVtlFOElKD38U0q7maMOp1QZvpCsRVshSHydpXtYW5DE+rppJXI3jt/Ta NY+e4zNockezWEIn4U3lL3Dam5tCkSlyC9SU+C8h2rG3MLNb277CZT2g75R5zmfwtXG4 BXRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=R2MK0kc5; 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 eb13si3262095edb.95.2021.05.20.10.33.15; Thu, 20 May 2021 10:33:39 -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=R2MK0kc5; 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 S234933AbhETKB3 (ORCPT + 99 others); Thu, 20 May 2021 06:01:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:60694 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231924AbhETJ5C (ORCPT ); Thu, 20 May 2021 05:57:02 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id E712B61627; Thu, 20 May 2021 09:37:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621503469; bh=GnE2Mid1xYoPgRWwU+m+5UdnTv4WO4oFBg/7XbvxAqE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=R2MK0kc5+p6X/4M98t631WOG6dzY9eQVP21ycY+4ObJk9QjboymJVKxP81OBp5xSs SvhEcs9NkH3CbASoE3swtR4KpD/P7fgI8ELeztJGblv4A2ygOiDtp7AWB/5yxJnC96 nfe4JTGHhBzLfo8ByOtrhMSOkLUJt3R12PnziWI8= 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 4.19 235/425] nvme: retrigger ANA log update if group descriptor isnt found Date: Thu, 20 May 2021 11:20:04 +0200 Message-Id: <20210520092139.153401198@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210520092131.308959589@linuxfoundation.org> References: <20210520092131.308959589@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 4ef05fe00dac..64f699a1afd7 100644 --- a/drivers/nvme/host/multipath.c +++ b/drivers/nvme/host/multipath.c @@ -516,6 +516,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 { mutex_lock(&ns->head->lock); -- 2.30.2