mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 10:31:46 +09:00
powerpc/mm/dax: Fix the condition when checking if altmap vmemap can cross-boundary
[ Upstream commitc8eebc4a99] Without this fix, the last subsection vmemmap can end up in memory even if the namespace is created with -M mem and has sufficient space in the altmap area. Fixes:cf387d9644("libnvdimm/altmap: Track namespace boundaries in altmap") Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com> Tested-by: Sachin Sant <sachinp@linux.ibm.com <mailto:sachinp@linux.ibm.com>> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://msgid.link/20230616110826.344417-6-aneesh.kumar@linux.ibm.com Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
ea356080c1
commit
4e6c406ccb
@@ -189,7 +189,7 @@ static bool altmap_cross_boundary(struct vmem_altmap *altmap, unsigned long star
|
|||||||
unsigned long nr_pfn = page_size / sizeof(struct page);
|
unsigned long nr_pfn = page_size / sizeof(struct page);
|
||||||
unsigned long start_pfn = page_to_pfn((struct page *)start);
|
unsigned long start_pfn = page_to_pfn((struct page *)start);
|
||||||
|
|
||||||
if ((start_pfn + nr_pfn) > altmap->end_pfn)
|
if ((start_pfn + nr_pfn - 1) > altmap->end_pfn)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (start_pfn < altmap->base_pfn)
|
if (start_pfn < altmap->base_pfn)
|
||||||
|
|||||||
Reference in New Issue
Block a user