Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp2282763imb; Mon, 4 Mar 2019 00:43:28 -0800 (PST) X-Google-Smtp-Source: APXvYqx9LytnBn+SBXA4ngFbNnDJy3JyL3Coa1rAAYixnlPPeAFUD0aAwmy31fkxLcFf3k3PGvMl X-Received: by 2002:a62:e11a:: with SMTP id q26mr18747679pfh.187.1551689008444; Mon, 04 Mar 2019 00:43:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551689008; cv=none; d=google.com; s=arc-20160816; b=C5Xj/4YJS3npCz5ziyGrz5aIUR0sjLK+Ta0CGwUxVpKqncmBgysuYoFdB7BSnv1MU1 d4LlwpaTyHaBsirn2uJo9/O+/YHXiYs4u8cX4cnVdj2O1w84Za8hf5x4xJI7Uikjl9Aw Gi8IZcAbJ3UI2l8V5/feQfjb5ypCRrUlczSjk+2Hnmy4KGkal7IlmwaMHYwQ3GE1a79+ pNmETluIH5QQuYVj5GCqmmUqIQJWpQMqOl1BfgTCP6uWJIeQvJNCt3wEtr3R6NHH+OBY 43OU2/HVkyu1LcZahwEltMgdcmIsciS4eH/v/GiHq40s3Bt/R2dlFR/i2qqGPsWKnOFg NUNw== 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=ffG0bHlZ0p4FR8lisaPRC0HGb5qirtOvBZFzvMGwZio=; b=YskwVe0aC+hQNGfpgXl9EdCPka9/U5R+bW8tnsUNb6QDWi9jrLXNE6nof8UEDX7pYe J6u0pWKRraj+j7iE8fO7yZZ4tv3O9AhQvmeveDRl+2hgSUuJ2Uqkt/LzAcbDQAsy7+K5 SiYjMPxlLzwm1Ywn5Dver6lKG7KgSDTFuUOPYuNaA9OmyFkCnQ0aiFvhuB+uLeNNsHW6 2avdbEa7cxSYQ3VGIJFNMm6xIIupxtmo/XqavhLaQONYwjD2EVZFanQKdTZSNCE7vCyK HOq723ijbSFZM9z+qlouc0Bo13laiTxhuu8xdUV+QfTmgHwUhQDuj8ZeSXS7WmbV/AU4 QXJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="oY/zHjcL"; 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 f11si1640176pgo.43.2019.03.04.00.43.11; Mon, 04 Mar 2019 00:43:28 -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="oY/zHjcL"; 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 S1726469AbfCDIlW (ORCPT + 99 others); Mon, 4 Mar 2019 03:41:22 -0500 Received: from mail.kernel.org ([198.145.29.99]:34912 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728013AbfCDIcA (ORCPT ); Mon, 4 Mar 2019 03:32:00 -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 06723208E4; Mon, 4 Mar 2019 08:31:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1551688319; bh=ocrGU+7uzT4DesRaxL8ixmKV72iFgpHKlgYkZ9e2Oqo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oY/zHjcLLScQTfvFg4XdRY04idG3sIV4b5PiX3r8hnri2vR4HsxQlwOjDbX0+Ngvl gN5ON78+jTyY2sY46HEGUiUZAFP7FaFDidxjaNBAWwlHRq9Xs03yeUii58mH9oHx1M aN6tl8MrckxTDACuE1LrE6cWw2c79srv+17WngHE= 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.19 54/78] nvme-multipath: drop optimization for static ANA group IDs Date: Mon, 4 Mar 2019 09:22:37 +0100 Message-Id: <20190304081627.908836482@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190304081625.508788074@linuxfoundation.org> References: <20190304081625.508788074@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.19-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 815509dbed846..da8f5ad30c719 100644 --- a/drivers/nvme/host/multipath.c +++ b/drivers/nvme/host/multipath.c @@ -531,8 +531,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