libnvdimm, pmem: adjust for section collisions with 'System RAM'
On a platform where 'Persistent Memory' and 'System RAM' are mixed within a given sparsemem section, trim the namespace and notify about the sub-optimal alignment. Cc: Toshi Kani <toshi.kani@hpe.com> Cc: Ross Zwisler <ross.zwisler@linux.intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
This commit is contained in:
@@ -299,6 +299,11 @@ int nd_pfn_validate(struct nd_pfn *nd_pfn)
|
||||
if (memcmp(pfn_sb->parent_uuid, parent_uuid, 16) != 0)
|
||||
return -ENODEV;
|
||||
|
||||
if (__le16_to_cpu(pfn_sb->version_minor) < 1) {
|
||||
pfn_sb->start_pad = 0;
|
||||
pfn_sb->end_trunc = 0;
|
||||
}
|
||||
|
||||
switch (le32_to_cpu(pfn_sb->mode)) {
|
||||
case PFN_MODE_RAM:
|
||||
case PFN_MODE_PMEM:
|
||||
|
Reference in New Issue
Block a user