Skip to content

Commit f101ada

Browse files
Wei Yangdjbw
authored andcommitted
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: ae86cbf "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>
1 parent f17b5f0 commit f101ada

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/nvdimm/pfn_devs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -678,7 +678,7 @@ static void trim_pfn_device(struct nd_pfn *nd_pfn, u32 *start_pad, u32 *end_trun
678678
if (region_intersects(start, size, IORESOURCE_SYSTEM_RAM,
679679
IORES_DESC_NONE) == REGION_MIXED
680680
|| !IS_ALIGNED(end, nd_pfn->align)
681-
|| nd_region_conflict(nd_region, start, size + adjust))
681+
|| nd_region_conflict(nd_region, start, size))
682682
*end_trunc = end - phys_pmem_align_down(nd_pfn, end);
683683
}
684684

0 commit comments

Comments
 (0)