Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp3020289pxb; Tue, 12 Jan 2021 04:31:07 -0800 (PST) X-Google-Smtp-Source: ABdhPJzzjkU5Mq+7SxjAu7pfXrD2nvG1uTe3vyP5Z2Y4KYXh1CzPkovZ+m1tSMO1kQAV4YMoi9E0 X-Received: by 2002:a17:906:26d7:: with SMTP id u23mr3015444ejc.210.1610454667440; Tue, 12 Jan 2021 04:31:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610454667; cv=none; d=google.com; s=arc-20160816; b=c/gbACKmGSJE7HGawvEbwiZQ/TIZz0/PJQU6RKHLV48fy4C61LhBaNnN09nK9hnrR5 DRPaXyOS5TQ26veAlGXDiyk0JphmvE6CZJDpil5a/rtsS0X4mx+egh6fUs9VMY33Hn5s ARE21uzVQvGKtrgCxN0uXqyT+L2uDyqH/zoa2XGRl86kDWUitWleiqclS294dzID1C/P sxvUYKsWgCpCvKbz3fyuYyTA3bpCwAOD6NtLdOvBUx8WEnzfnH8hkiOQ4fe/k9pAIZ72 NP3g7bR9Oo48rrjT/0Z6BaDmCMYmLAXkxb/hR6mJk/8yhw+bqKJeOO9dlHJktpgaVFTq x+cg== 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=yP9jIUGRKkZ+KucxVBBQ11VgnM8ymJhRHc9AkW4iWtRPIrQoWEIMsL0wWve/GRLRLm V7yuB7iJ/gKU9SeBa+wkSWy9ulLJmpDdnnrBzpU3K0lLS3uIPM5iOyuR+G5ofizswBES MHyGYPewEvrepDi5Accn8fSdkKx4X07YySxLsIYuAi4G0UaX50FPWytQ+Ny19Ma76Hb6 O2iEC8IxZ2rG5/xHF+LkeGBJxW1moQf9Xpz43g+R7yz/JXiyEB0v3bSSBJiFN6s3NRUE 1QyVgX2o4T6shdU6eWHX6xLTTlcqjbGe7txw8Qaa8Kt9JkdciCL06sHFUUwHBdCxtn+5 8Yvg== 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 e22si1340823edu.9.2021.01.12.04.30.43; Tue, 12 Jan 2021 04:31:07 -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 S2392730AbhALJfp (ORCPT + 99 others); Tue, 12 Jan 2021 04:35:45 -0500 Received: from mga04.intel.com ([192.55.52.120]:27807 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2392715AbhALJfo (ORCPT ); Tue, 12 Jan 2021 04:35:44 -0500 IronPort-SDR: hQVrSipWi1753H5bqOW6loq9qg2aye7L7HEyfkokPoUWxbj/bCbrK5Yr77kJdXl66qDJZpQ67S ciPDy7Nklamw== X-IronPort-AV: E=McAfee;i="6000,8403,9861"; a="175431872" X-IronPort-AV: E=Sophos;i="5.79,341,1602572400"; d="scan'208";a="175431872" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga104.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 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;