Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp205794imj; Thu, 14 Feb 2019 18:40:10 -0800 (PST) X-Google-Smtp-Source: AHgI3IZkrtuPzwLq5MzkP6ZcJwEYee/7Wx8breTdfMmzEPShi1Tf/7I0ieZzbbx+Sh60twCv7ZrC X-Received: by 2002:a62:5007:: with SMTP id e7mr7464646pfb.92.1550198410277; Thu, 14 Feb 2019 18:40:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550198410; cv=none; d=google.com; s=arc-20160816; b=wwV0dE3KQJTCcuOSph4z8aBtUVoBZXD/cFSE2EKMAlxqRfXvOQ4rZbg15e1T2H2MbI tZUpCJpNM26rYOw6c8xPpkY0369NHmmSNEEdTm3mUQYt0blAj6zBHDK7gAD8KnzCCWVV 00ksD6zguOSD6hf0KWMnrtfMvsYBykWUgjL9jbuBVbBZnBA97r8Sd+ULWOO4vSzeleGG jii/UZyZjJ+OeOmpy193WXuD7FmJ3g4b6EEg97ogad2VKsub6xAsxku7WXndxAzNqJZd oO+TtQ7jxdHHFzozvtL8TnroAfBHgy8NUnefLdn8UmkW5UaBpNz+jB7hTOp1m1Bblugv aP9g== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=SlWIxLXos+qnBTv4hl4m/TWqMtGeElhz376byFOeSxM=; b=lMxzAnRQvDDN67UukofNWR7t6DHBIjIGrg3IilEODGhCvML92beYa3hYa/LpFHm/K0 6M2LbHCMXQ7ygenRE7kCJKysnsaHXgP144TXtzqJETtikC7awq3mt1jg+wIpnid78ydQ S+Djf5FiNNYPj3cMVcZ+6hMI7NJGmdwIKyGm4j+BG7QRHl91mwpr989oJXsit0X9jfKJ xhevnKbopGQdkfr6EFrG+0SDEnUp8mWtKhgagR097XvDjuCIbpl1zS5nvjdXQYG+nKvJ 0SyB5aiV/JDctPGJNsYqAD6+zHT4rc/K2cT8k8nj7bXGh4DQlPftmHKhVcF0l62QoAay lqmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=UzmuUuJN; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f20si4237518plr.419.2019.02.14.18.39.54; Thu, 14 Feb 2019 18:40:10 -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=UzmuUuJN; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388993AbfBOChG (ORCPT + 99 others); Thu, 14 Feb 2019 21:37:06 -0500 Received: from mail.kernel.org ([198.145.29.99]:50790 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390627AbfBOCKh (ORCPT ); Thu, 14 Feb 2019 21:10:37 -0500 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 94D28222D7; Fri, 15 Feb 2019 02:10:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1550196636; bh=2flhbers7AKAxiXeNOxNrn0Yimkyb3qPfSEZA4IiV+4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UzmuUuJNLiURWFbNH/P4gVu9xERjdP46yL4cJqNc/+oDeChb2Wpqm6beWc8Qepu1r +QEaaxj+CWbgoTvzwXw4VIrnr21HNdq2JEe8r51UQI5HeIuKd42dcYD8twQ5TTF7Hq KH6gwK1xAvHymZ18bwlt9ZRTOn+CyLvXtg6h+ZjI= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Hannes Reinecke , Hannes Reinecke , Sagi Grimberg , Jens Axboe , Sasha Levin , linux-nvme@lists.infradead.org Subject: [PATCH AUTOSEL 4.20 61/77] nvme-multipath: drop optimization for static ANA group IDs Date: Thu, 14 Feb 2019 21:08:39 -0500 Message-Id: <20190215020855.176727-61-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190215020855.176727-1-sashal@kernel.org> References: <20190215020855.176727-1-sashal@kernel.org> MIME-Version: 1.0 X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Hannes Reinecke [ 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 9901afd804ce..266bac07ed11 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