Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp4171871pxb; Mon, 8 Feb 2021 09:33:19 -0800 (PST) X-Google-Smtp-Source: ABdhPJzP034TF7/t+4tYPYXsrNBzedlxZEcuiuG3Jha4HwXCAwIdTi/GiTfaQMlY95qaFGp7j8Gm X-Received: by 2002:a17:906:c04f:: with SMTP id bm15mr18068425ejb.364.1612805598896; Mon, 08 Feb 2021 09:33:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612805598; cv=none; d=google.com; s=arc-20160816; b=m9xe6CH430ZmxrLxA1EGa/wnE5YOJk2otrBClNiNeCLHUU54cvrRXC1NgRIu2ZkLdN xNkRitvwmPPDIzddCwekeIpQxANPJgOwrLsUDIMOIRFiG0AnFsueY/7SVOsS0Udt35go PBUBRwcNbTzPbZ0OBcdko2HqeP77MHoCTh6GOHBR6YGTyusRKhVjAKZaK4LoTfcEP7Hc Ogq+vieFLTkwc9aN6iQtsFc5K9Eig/Z9XDXKuz9as4a22fo86PhdEEGCQ5LO6ADG1P7v 3Wl91qbpvozmC+xu/aRmkKCfXYP2gT62NRxGlv/IDdxiyOnfhe2oBbLu35FlQvfjj2X/ 6wUg== 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=yjSq1io03PR7ZkPZS/OYxgO3uJIhMJzXHOMgF4tDkgQ=; b=kRbhyjVIdGnoG9rxv2q+pW/UXZ/OrdjiDwA76x/PcsxJv2X0Nvjy86Kx+e2RYk3yXc cDWjmxIUUCZMn7ksEl1lWBlQ4s1dYPNt/nEAP5qoHdUNyiyhSmGg15dwTadZapylP9ZR baiGYB5FTQ7k/i9Jkv7aSvpm++Hn8P/LY6biuIKNNd9/tulyopfyZ/gBrmrYEME+juk1 0ArsFNvBadijfzDSjlsXgdES8YKADMGibic94sS7/qnnn2nmqDLGMP4Z2BrksDuK/FDS ZdncZGV8pw9bDVqm6XyhrLl6zjTkV/ihupwbywbA2Aig0ALdZ/7kiBUjFKMqQPVkDeEK RyxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=cjwEFUon; 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 v4si15253555edj.37.2021.02.08.09.32.54; Mon, 08 Feb 2021 09:33:18 -0800 (PST) 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=cjwEFUon; 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 S234518AbhBHRcU (ORCPT + 99 others); Mon, 8 Feb 2021 12:32:20 -0500 Received: from mail.kernel.org ([198.145.29.99]:36904 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231272AbhBHP3N (ORCPT ); Mon, 8 Feb 2021 10:29:13 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 2E7EE64F2E; Mon, 8 Feb 2021 15:16:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1612797399; bh=ilixUZofVXuX/kSws9C+KNaGMev1IFswAxbrRQ9+eEE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cjwEFUon2oxmnaInhf+SMOa0m42KJccS1BvHtdydXwrokyQXsZA23xEn7BDsBRcy4 6EkkIR2r1Z3+2JvKlXobn8c9asv/5u1c/VYFKq31D++t2yfB4L5FJiOx4vuqrRZD8T fpCeSoJd0kntABev4hC9bCQjjFiBvXG7MCbKQKp0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Vishal Verma , Dave Jiang , Ira Weiny , Dan Williams Subject: [PATCH 5.10 064/120] libnvdimm/namespace: Fix visibility of namespace resource attribute Date: Mon, 8 Feb 2021 16:00:51 +0100 Message-Id: <20210208145820.980486149@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210208145818.395353822@linuxfoundation.org> References: <20210208145818.395353822@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: Dan Williams commit 13f445d65955f388499f00851dc9a86280970f7c upstream. Legacy pmem namespaces lost support for the "resource" attribute when the code was cleaned up to put the permission visibility in the declaration. Restore this by listing 'resource' in the default attributes. A new ndctl regression test for pfn_to_online_page() corner cases builds on this fix. Fixes: bfd2e9140656 ("libnvdimm: Simplify root read-only definition for the 'resource' attribute") Cc: Vishal Verma Cc: Dave Jiang Cc: Ira Weiny Cc: Link: https://lore.kernel.org/r/161052334995.1805594.12054873528154362921.stgit@dwillia2-desk3.amr.corp.intel.com Signed-off-by: Dan Williams Signed-off-by: Greg Kroah-Hartman --- drivers/nvdimm/namespace_devs.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) --- a/drivers/nvdimm/namespace_devs.c +++ b/drivers/nvdimm/namespace_devs.c @@ -1635,11 +1635,11 @@ static umode_t namespace_visible(struct return a->mode; } - if (a == &dev_attr_nstype.attr || a == &dev_attr_size.attr - || a == &dev_attr_holder.attr - || a == &dev_attr_holder_class.attr - || a == &dev_attr_force_raw.attr - || a == &dev_attr_mode.attr) + /* base is_namespace_io() attributes */ + if (a == &dev_attr_nstype.attr || a == &dev_attr_size.attr || + a == &dev_attr_holder.attr || a == &dev_attr_holder_class.attr || + a == &dev_attr_force_raw.attr || a == &dev_attr_mode.attr || + a == &dev_attr_resource.attr) return a->mode; return 0;