Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

libnvdimm/namespace: Fix visibility of namespace resource attribute

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 <vishal.l.verma@intel.com>
Cc: Dave Jiang <dave.jiang@intel.com>
Cc: Ira Weiny <ira.weiny@intel.com>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/161052334995.1805594.12054873528154362921.stgit@dwillia2-desk3.amr.corp.intel.com
Signed-off-by: Dan Williams <dan.j.williams@intel.com>

+5 -5
+5 -5
drivers/nvdimm/namespace_devs.c
··· 1635 1635 return a->mode; 1636 1636 } 1637 1637 1638 - if (a == &dev_attr_nstype.attr || a == &dev_attr_size.attr 1639 - || a == &dev_attr_holder.attr 1640 - || a == &dev_attr_holder_class.attr 1641 - || a == &dev_attr_force_raw.attr 1642 - || a == &dev_attr_mode.attr) 1638 + /* base is_namespace_io() attributes */ 1639 + if (a == &dev_attr_nstype.attr || a == &dev_attr_size.attr || 1640 + a == &dev_attr_holder.attr || a == &dev_attr_holder_class.attr || 1641 + a == &dev_attr_force_raw.attr || a == &dev_attr_mode.attr || 1642 + a == &dev_attr_resource.attr) 1643 1643 return a->mode; 1644 1644 1645 1645 return 0;