mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-11 02:59:12 +00:00
libnvdimm/pmem: Honor force_raw for legacy pmem regions
commitfa7d2e639c
upstream. 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:004f1afbe1
("libnvdimm, pmem: direct map legacy pmem by default") Signed-off-by: Dan Williams <dan.j.williams@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
6a89ed7aa1
commit
696c37524b
1 changed files with 4 additions and 0 deletions
|
@ -138,6 +138,7 @@ bool nd_is_uuid_unique(struct device *dev, u8 *uuid)
|
|||
bool pmem_should_map_pages(struct device *dev)
|
||||
{
|
||||
struct nd_region *nd_region = to_nd_region(dev->parent);
|
||||
struct nd_namespace_common *ndns = to_ndns(dev);
|
||||
struct nd_namespace_io *nsio;
|
||||
|
||||
if (!IS_ENABLED(CONFIG_ZONE_DEVICE))
|
||||
|
@ -149,6 +150,9 @@ bool pmem_should_map_pages(struct device *dev)
|
|||
if (is_nd_pfn(dev) || is_nd_btt(dev))
|
||||
return false;
|
||||
|
||||
if (ndns->force_raw)
|
||||
return false;
|
||||
|
||||
nsio = to_nd_namespace_io(dev);
|
||||
if (region_intersects(nsio->res.start, resource_size(&nsio->res),
|
||||
IORESOURCE_SYSTEM_RAM,
|
||||
|
|
Loading…
Reference in a new issue