Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp158317pxb; Tue, 12 Jan 2021 23:39:44 -0800 (PST) X-Google-Smtp-Source: ABdhPJwO2Jx3WeJcZwNy2fDamW1lot3EITxvejkha8hmh6HlUrIDyNOH/u1qzsbpwhxfmPD+TUzx X-Received: by 2002:a05:6402:797:: with SMTP id d23mr735516edy.302.1610523584204; Tue, 12 Jan 2021 23:39:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610523584; cv=none; d=google.com; s=arc-20160816; b=X4HaO8s18g+X9apNPObjwxRwFZkyYzpG+7/lbJdan3utw2MAB0oSyxy6lgyEgMWhB0 BVHq9aNseLViZyrC79RjT+q5GfaSpCubhSbosUYB0gcqOMmnVwkQ2mdiFL4jLV5iNeiB szXgatKfCALvi3dS73gC0j1T2sViD04hfA/L3TjhVN/abzMg5eCPSI310U5O6ASsKo1g BSD/9z1XXdRM0vbOwu+TqFnQeCxKHadXPGHXw2k7mwppt7Uv5r6Y4dman+1RR5VEnZNI EPqUM7ZWqngaPAIPnWbcaXXoMvjvqd07jLQETx/lRuR+3UYg33rLBZCOpI33hBlxBL6t g5Gw== 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:cc:to:from :subject:ironport-sdr:ironport-sdr; bh=Z4Mt9G5fdIwVG7PzBiU1h9sBrmh5MBRdAK8YGb+WAVg=; b=baZ5ypScOkmbxW5cdtuvsmhihxDoeHOgAcC8CoXe0CinrS/2P/VswY9K47PuDVlEvC /L3k/gFnwcspPjrcRcaGEvnbH3HM1uxDuaYc+zWacrV/HVXimMLdJhxxVayCv9dXpZKO DEhxpzO+cisccMjsCk4r9GPntWnweMf51Kq7JSLaoJydb9aSiYUVAZIXuvVfIpI//pjJ sZZm86OH3emtfxlK6tvrZC8gv5FLbrWi4PZukEo7IEJI2PA5t7YBbCdeT03/UeClPRYl K95Df9deRY13PgmObPXm9zst0xIbMcn3wzlw3rUsk8ouB9qrc5qIa9kOK7HqzOEZx7ga JYUA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w2si581504edx.591.2021.01.12.23.39.20; Tue, 12 Jan 2021 23:39:44 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726664AbhAMHgc (ORCPT + 99 others); Wed, 13 Jan 2021 02:36:32 -0500 Received: from mga04.intel.com ([192.55.52.120]:44299 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726030AbhAMHgb (ORCPT ); Wed, 13 Jan 2021 02:36:31 -0500 IronPort-SDR: ASxNLmIT8ClOGYg3/e3O3l9LUdH8eeVVTZY+b5TtDZXlaXcs4L0WYODH19x0cbgOhH4kIqBnSG FgS/EIeHH1qg== X-IronPort-AV: E=McAfee;i="6000,8403,9862"; a="175583402" X-IronPort-AV: E=Sophos;i="5.79,343,1602572400"; d="scan'208";a="175583402" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jan 2021 23:35:50 -0800 IronPort-SDR: d8GujxA6lUoNjhNaAJz9tCcEE8MtX/S74Fsm93UPPhEDTmgKMmxzwKKQoyDeaITQtrNsVU9w4Y vwsXOaj6HKog== X-IronPort-AV: E=Sophos;i="5.79,343,1602572400"; d="scan'208";a="404741126" Received: from dwillia2-desk3.jf.intel.com (HELO dwillia2-desk3.amr.corp.intel.com) ([10.54.39.25]) by fmsmga003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jan 2021 23:35:50 -0800 Subject: [PATCH v3 6/6] libnvdimm/namespace: Fix visibility of namespace resource attribute From: Dan Williams To: linux-mm@kvack.org Cc: Vishal Verma , Dave Jiang , Ira Weiny , stable@vger.kernel.org, linux-nvdimm@lists.01.org, linux-kernel@vger.kernel.org Date: Tue, 12 Jan 2021 23:35:50 -0800 Message-ID: <161052334995.1805594.12054873528154362921.stgit@dwillia2-desk3.amr.corp.intel.com> In-Reply-To: <161052331545.1805594.2356512831689786960.stgit@dwillia2-desk3.amr.corp.intel.com> References: <161052331545.1805594.2356512831689786960.stgit@dwillia2-desk3.amr.corp.intel.com> User-Agent: StGit/0.18-3-g996c MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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: Signed-off-by: Dan Williams --- drivers/nvdimm/namespace_devs.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/nvdimm/namespace_devs.c b/drivers/nvdimm/namespace_devs.c index 6da67f4d641a..2403b71b601e 100644 --- a/drivers/nvdimm/namespace_devs.c +++ b/drivers/nvdimm/namespace_devs.c @@ -1635,11 +1635,11 @@ static umode_t namespace_visible(struct kobject *kobj, 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;