summaryrefslogtreecommitdiffstats
path: root/drivers/nvdimm/pfn_devs.c
diff options
context:
space:
mode:
authorWei Yang <richardw.yang@linux.intel.com>2019-01-22 10:48:09 +0800
committerDan Williams <dan.j.williams@intel.com>2019-02-12 10:18:44 -0800
commitf101ada7da6551127d192c2f1742c1e9e0f62799 (patch)
treedcb5fdae196c8c5ed566b074c56d2c045d5a91c9 /drivers/nvdimm/pfn_devs.c
parentf17b5f06cb92ef2250513a1e154c47b78df07d40 (diff)
downloadlinux-f101ada7da6551127d192c2f1742c1e9e0f62799.tar.bz2
libnvdimm, pfn: Fix over-trim in trim_pfn_device()
When trying to see whether current nd_region intersects with others, trim_pfn_device() has already calculated the *size* to be expanded to SECTION size. Do not double append 'adjust' to 'size' when calculating whether the end of a region collides with the next pmem region. Fixes: ae86cbfef381 "libnvdimm, pfn: Pad pfn namespaces relative to other regions" Cc: <stable@vger.kernel.org> Signed-off-by: Wei Yang <richardw.yang@linux.intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/nvdimm/pfn_devs.c')
-rw-r--r--drivers/nvdimm/pfn_devs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/nvdimm/pfn_devs.c b/drivers/nvdimm/pfn_devs.c
index 6f22272e8d80..040bbd9c367e 100644
--- a/drivers/nvdimm/pfn_devs.c
+++ b/drivers/nvdimm/pfn_devs.c
@@ -678,7 +678,7 @@ static void trim_pfn_device(struct nd_pfn *nd_pfn, u32 *start_pad, u32 *end_trun
if (region_intersects(start, size, IORESOURCE_SYSTEM_RAM,
IORES_DESC_NONE) == REGION_MIXED
|| !IS_ALIGNED(end, nd_pfn->align)
- || nd_region_conflict(nd_region, start, size + adjust))
+ || nd_region_conflict(nd_region, start, size))
*end_trunc = end - phys_pmem_align_down(nd_pfn, end);
}