libnvdimm, pmem: fix 'pfn' support for section-misaligned namespaces
authorDan Williams <dan.j.williams@intel.com>
Thu, 3 Mar 2016 17:14:36 +0000 (09:14 -0800)
committerDan Williams <dan.j.williams@intel.com>
Sat, 5 Mar 2016 20:25:44 +0000 (12:25 -0800)
commitd9cbe09d39aa13f6924dc5fb88325de7ef01a72e
tree8d2e60e548272353fbfa8bd9ac705cdfac918efc
parentbc94b99636dc7bcccce439a9fb9c00065e2e2627
libnvdimm, pmem: fix 'pfn' support for section-misaligned namespaces

The altmap for a section-misaligned namespace needs to arrange for the
base_pfn to be section-aligned.  As a result the 'reserve' region (pfns
from base that do not have a struct page) must be increased.  Otherwise
we trip the altmap validation check in __add_pages:

if (altmap->base_pfn != phys_start_pfn
|| vmem_altmap_offset(altmap) > nr_pages) {
pr_warn_once("memory add fail, invalid altmap\n");
return -EINVAL;
}

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
drivers/nvdimm/pfn.h
drivers/nvdimm/pmem.c
This page took 0.027374 seconds and 5 git commands to generate.