Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4619350pxj; Wed, 12 May 2021 09:22:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzNYZhWwI8BViU6MUqSiVY6A4FbiVdhbwelbrrOY/YRkJyjIA7UX0Y8pOGqgk+RwLZu8DG4 X-Received: by 2002:aca:3986:: with SMTP id g128mr22143543oia.126.1620836534107; Wed, 12 May 2021 09:22:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620836534; cv=none; d=google.com; s=arc-20160816; b=IGyD3g7X0dC9qUJfciTZo/hkBKZ1vosWTrvaBrGBOQKGigJprNLRGQcXwqMANkB/L+ SrwFFSrR37/1QvRQ6p+r65IE0iyGgN+DsAv5f5hNuctT2O4htKjMRPrRpVMd/4C566oh v5Z1Jvg9Rmc8on98ANa98yvbWjPdNgu4NA3An9ML6x+30BKsjqq2L/lE1p24EAB2p1R0 zAm7PwDOywjrMcO44q/+FcOIFWXcPeAsoM3nfBGW/WfTA8Pi6zJZKIzSAO6HH9/iwYay K+/rD/GeGkk2hjLJ07b1sIOH+O1Is+04GKJ4fMkIwctCdpz1x8jb/OCERI7aI+2/LKWJ oFSQ== 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=K5oKqkcmHfNlYLkgruSr1wJK2jB/qLW7eLpFG2AqHTk=; b=V57mgMyru6eqDCa+NNgknwBaIQE1gZ7eR0F2sIOchsRkG5+Y/vhKYA8s5/OfUI7sPE Dvyr9c/xldyZCARt539nLfSPOpDCuloA9FUX8AU2AHqhQnwTmh5qfdWGPGdvK86m/sUk Sf0oQmtm6+lzGK+ZKbpY4ob2ChC+CK1rQ7sIfugvIYfb3Q6wN11GfwVL5VtOJkPC5TcG GeFENeNAorx8iay/NqUcEder8poOSZBB3+iY5bpN89aj8nLlY/mvugymBh3kvAEyUQNk Ika15LtMaA4Cwu1KBnIjStKuOj+nc/GolufDtOdfU6MAWE99iVt1HRhcmHwDAIglr19U 3NoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=myRdFj45; 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 u72si360223oif.179.2021.05.12.09.21.59; Wed, 12 May 2021 09:22:14 -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=myRdFj45; 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 S238032AbhELQO6 (ORCPT + 99 others); Wed, 12 May 2021 12:14:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:39912 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233701AbhELP3E (ORCPT ); Wed, 12 May 2021 11:29:04 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id AF0A26193E; Wed, 12 May 2021 15:15:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620832518; bh=FG5kT/gty4np41y74Sjdqb2aFVfHc88v4Z11q4JpcF4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=myRdFj45q7RMshoXDc1e3AUYYPvHwrMWsVdrqc5l3HlBTqHG6JqpjZJ372S+cj5Nz S1tvik+au5FOw/c05qifms2pXmhYB0lzbL2ruzxkh9n2xAOOec7hZhzSgv8nF8H615 JICGySI3PqkAtvUIzZXQiykMivD9KIlull0XAx4c= 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.10 312/530] nvme: retrigger ANA log update if group descriptor isnt found Date: Wed, 12 May 2021 16:47:02 +0200 Message-Id: <20210512144830.060729757@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210512144819.664462530@linuxfoundation.org> References: <20210512144819.664462530@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 e812a0d0fdb3..f750cf98ae26 100644 --- a/drivers/nvme/host/multipath.c +++ b/drivers/nvme/host/multipath.c @@ -667,6 +667,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