Skip to content

Commit fa7d2e6

Browse files
committed
libnvdimm/pmem: Honor force_raw for legacy pmem regions
For recovery, where non-dax access is needed to a given physical address range, and testing, allow the 'force_raw' attribute to override the default establishment of a dev_pagemap. Otherwise without this capability it is possible to end up with a namespace that can not be activated due to corrupted info-block, and one that can not be repaired due to a section collision. Cc: <stable@vger.kernel.org> Fixes: 004f1af ("libnvdimm, pmem: direct map legacy pmem by default") Signed-off-by: Dan Williams <dan.j.williams@intel.com>
1 parent 11a3581 commit fa7d2e6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/nvdimm/namespace_devs.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ bool nd_is_uuid_unique(struct device *dev, u8 *uuid)
138138
bool pmem_should_map_pages(struct device *dev)
139139
{
140140
struct nd_region *nd_region = to_nd_region(dev->parent);
141+
struct nd_namespace_common *ndns = to_ndns(dev);
141142
struct nd_namespace_io *nsio;
142143

143144
if (!IS_ENABLED(CONFIG_ZONE_DEVICE))
@@ -149,6 +150,9 @@ bool pmem_should_map_pages(struct device *dev)
149150
if (is_nd_pfn(dev) || is_nd_btt(dev))
150151
return false;
151152

153+
if (ndns->force_raw)
154+
return false;
155+
152156
nsio = to_nd_namespace_io(dev);
153157
if (region_intersects(nsio->res.start, resource_size(&nsio->res),
154158
IORESOURCE_SYSTEM_RAM,

0 commit comments

Comments
 (0)