From patchwork Tue Jan 12 09:35:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Williams X-Patchwork-Id: 12012901 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2FE2AC433E0 for ; Tue, 12 Jan 2021 09:35:09 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id A2EE323100 for ; Tue, 12 Jan 2021 09:35:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A2EE323100 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id DDA8F8D0081; Tue, 12 Jan 2021 04:35:07 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id D89A98D0051; Tue, 12 Jan 2021 04:35:07 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C9F7B8D0081; Tue, 12 Jan 2021 04:35:07 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0200.hostedemail.com [216.40.44.200]) by kanga.kvack.org (Postfix) with ESMTP id B47E38D0051 for ; Tue, 12 Jan 2021 04:35:07 -0500 (EST) Received: from smtpin30.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 859A7A8C0 for ; Tue, 12 Jan 2021 09:35:07 +0000 (UTC) X-FDA: 77696614254.30.tree05_2702cc627514 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin30.hostedemail.com (Postfix) with ESMTP id 65A03180B3AA7 for ; Tue, 12 Jan 2021 09:35:07 +0000 (UTC) X-HE-Tag: tree05_2702cc627514 X-Filterd-Recvd-Size: 3393 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by imf07.hostedemail.com (Postfix) with ESMTP for ; Tue, 12 Jan 2021 09:35:06 +0000 (UTC) IronPort-SDR: sQS8NTqHCAfWDK3zUPM4IcumXJvMpAxqoipnyjMZwANz4AQ++MthWWVRWjIR16pccWFNsfxeJV O+zkbfd5CXoQ== X-IronPort-AV: E=McAfee;i="6000,8403,9861"; a="262797484" X-IronPort-AV: E=Sophos;i="5.79,341,1602572400"; d="scan'208";a="262797484" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jan 2021 01:35:04 -0800 IronPort-SDR: HVZqNl53V65Tso0tlSZDAki2BhNRCeDvuLlb4LwKZ9nWDLF/vuZHYg39G/jHHA2AHqRaEJUf/a rqUR72lW1F8A== X-IronPort-AV: E=Sophos;i="5.79,341,1602572400"; d="scan'208";a="381355078" Received: from dwillia2-desk3.jf.intel.com (HELO dwillia2-desk3.amr.corp.intel.com) ([10.54.39.25]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jan 2021 01:35:04 -0800 Subject: [PATCH v2 5/5] 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 01:35:03 -0800 Message-ID: <161044410393.1482714.2866941280476392381.stgit@dwillia2-desk3.amr.corp.intel.com> In-Reply-To: <161044407603.1482714.16630477578392768273.stgit@dwillia2-desk3.amr.corp.intel.com> References: <161044407603.1482714.16630477578392768273.stgit@dwillia2-desk3.amr.corp.intel.com> User-Agent: StGit/0.18-3-g996c MIME-Version: 1.0 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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;