Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp2280188imb; Mon, 4 Mar 2019 00:38:14 -0800 (PST) X-Google-Smtp-Source: APXvYqyXzOrO5nHRcVIb6U1D6lDIlt2L5FeKIHskN32btno7MEa9tzVxRHp5NTONQB67WAE48MvN X-Received: by 2002:a17:902:e192:: with SMTP id cd18mr19577319plb.309.1551688693967; Mon, 04 Mar 2019 00:38:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551688693; cv=none; d=google.com; s=arc-20160816; b=LBJv2oEDERs7Ob9M/T95s1C/5ZpUrnwDYgmUGTJ2YS/d3tqFQHyrg6VkuJuCD6hQgM WC5Hg3bs8hbM3f0ndq7RgCC6REyMBZyS2/IF+J0bqWBkxsKv8TqFBI0vsHXXH/VyS7H4 zxOdcr8eUjgM/KQ6scyC9s+HSxjnIMAkQuyFf3xYPyAQaOl9250HxK3DbiBGUDYNkrS2 TiLT9Gw7nHJWdmWmeYSXmj4+VJ2A73YizonfXZCcuPFx+V/ETnmbmNxPqzZkfGMyfnf3 QcxprkbuiOJ0G+VThtnhFFT+iZXVsKoW0bXqhq722kNM33rA7II+tQ2h/+QJ5acQg8lS F8Kg== 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=987HoQHrZ/IHEmUHwUIMRWOJMCbCsjptBCDgLZtLzRE=; b=sqmp383nmznAIV/N/67PaXAPx8iBBAImkXuXXX6h32qkd+qH1w2SUcEzuxfr+V2nZX /ehSM00J9481ACDc59wuy/NCJzWc68IbbVW2a0sEJi5zmIAnhuxr4xeoxh5zkSHESLzz UsdbhGT1pWDloelEnaBLcLxoEFaHvlnavIYvJ8SiEoewYJ6mBzepYfdMvGS9bQpuop2j Ul7r7j2U3hwb0jonMM8oluBiPLAaKFfcxGo1Z+SELIYlokl4D+Kpmvw/Q9YcvZID3Dgr gsqAvnlNuIGMR32tA9DMz8npJMHKPL3PHQ5NqA7IkBdCXmybBWIVlVRQQGmTyBXB1Vs8 MaHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=iKV75WYb; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u18si2380344pfm.84.2019.03.04.00.37.53; Mon, 04 Mar 2019 00:38:13 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=iKV75WYb; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726510AbfCDIhY (ORCPT + 99 others); Mon, 4 Mar 2019 03:37:24 -0500 Received: from mail.kernel.org ([198.145.29.99]:45428 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728362AbfCDIgW (ORCPT ); Mon, 4 Mar 2019 03:36:22 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.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 CFB3820836; Mon, 4 Mar 2019 08:36:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1551688581; bh=TRt1CZic8GZiVyirG6/3cdlB66cN0akg98UsL4hDq0I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iKV75WYbk7/5a9Y81fvMmNC/yadM9nYSHHE2q2cE7bGSD5jr3BDdAdkVFIi+8J21U vhRitVLXKuUZQrTkm0FPSVrKri6RNLj6YhEFPqOE8urL8uHFetWW3ckKzWnhkOa19/ kqTQNd6mZXMaUiCv5PorOBImDxVHAO+6Lw3kY5Mg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Christoph Hellwig , Hannes Reinecke , Sagi Grimberg , Jens Axboe , Sasha Levin Subject: [PATCH 4.20 54/88] nvme-multipath: drop optimization for static ANA group IDs Date: Mon, 4 Mar 2019 09:22:37 +0100 Message-Id: <20190304081632.678161515@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190304081630.610632175@linuxfoundation.org> References: <20190304081630.610632175@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore 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 4.20-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit 78a61cd42a64f3587862b372a79e1d6aaf131fd7 ] Bit 6 in the ANACAP field is used to indicate that the ANA group ID doesn't change while the namespace is attached to the controller. There is an optimisation in the code to only allocate space for the ANA group header, as the namespace list won't change and hence would not need to be refreshed. However, this optimisation was never carried over to the actual workflow, which always assumes that the buffer is large enough to hold the ANA header _and_ the namespace list. So drop this optimisation and always allocate enough space. Reviewed-by: Christoph Hellwig Signed-off-by: Hannes Reinecke Signed-off-by: Sagi Grimberg Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin --- drivers/nvme/host/multipath.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/nvme/host/multipath.c b/drivers/nvme/host/multipath.c index 2b1d1f066efaf..6ea7c266a9cad 100644 --- a/drivers/nvme/host/multipath.c +++ b/drivers/nvme/host/multipath.c @@ -561,8 +561,7 @@ int nvme_mpath_init(struct nvme_ctrl *ctrl, struct nvme_id_ctrl *id) timer_setup(&ctrl->anatt_timer, nvme_anatt_timeout, 0); ctrl->ana_log_size = sizeof(struct nvme_ana_rsp_hdr) + ctrl->nanagrpid * sizeof(struct nvme_ana_group_desc); - if (!(ctrl->anacap & (1 << 6))) - ctrl->ana_log_size += ctrl->max_namespaces * sizeof(__le32); + ctrl->ana_log_size += ctrl->max_namespaces * sizeof(__le32); if (ctrl->ana_log_size > ctrl->max_hw_sectors << SECTOR_SHIFT) { dev_err(ctrl->device, -- 2.19.1