[PATCH v2] Fix: Exclude pages correctly in exclude_nodata_pages()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The calculation of the starting PFN for exclusion in
exclude_nodata_pages() was rounding down, potentially excluding
the last valid page of a LOAD segment.

This commit fixes the issue by rounding up the calculated PFN to the
nearest page boundary, ensuring that the last valid page is included and
not erroneously excluded.

Signed-off-by: Ming Wang <wangming01@xxxxxxxxxxx>
---
 makedumpfile.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/makedumpfile.c b/makedumpfile.c
index 2fa67e7..b356eb3 100644
--- a/makedumpfile.c
+++ b/makedumpfile.c
@@ -5215,7 +5215,7 @@ exclude_nodata_pages(struct cycle *cycle)
 				   NULL, &file_size)) {
 		unsigned long long pfn, pfn_end;
 
-		pfn = paddr_to_pfn(phys_start + file_size);
+		pfn = paddr_to_pfn(roundup(phys_start + file_size, PAGESIZE()));
 		pfn_end = paddr_to_pfn(roundup(phys_end, PAGESIZE()));
 
 		if (pfn < cycle->start_pfn)
-- 
2.39.2


_______________________________________________
kexec mailing list
kexec@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/kexec



[Index of Archives]     [LM Sensors]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [Kernel]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux