[PATCH] makedumpfile: Stop adjusting info->max_mapnr when no mem_maps are found.

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

 



Hello,

I found an issue during the test for v1.5.7, so I fixed it
by the patch below and I'm re-testing now.
I'm still going to release v1.5.7 in this week, please
wait a little longer.


Thanks
Atsushi Kumagai

From: Atsushi Kumagai <kumagai-atsushi@xxxxxxxxxxxxxxxxx>
Date: Mon, 8 Sep 2014 16:04:17 +0900
Subject: [PATCH] Stop adjusting info->max_mapnr when no mem_maps are found.

If mem_maps are allocated with remap allocator, makedumpfile can't
find them without vmlinux. In that case, info->max_mapnr will be
truncated to 0 and there will be no page data in a dump file.

This patch enables the environment above to save full dump at
least.

Signed-off-by: Atsushi Kumagai <kumagai-atsushi at mxc.nes.nec.co.jp>
---
 makedumpfile.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/makedumpfile.c b/makedumpfile.c
index c965745..230e5fd 100644
--- a/makedumpfile.c
+++ b/makedumpfile.c
@@ -2963,12 +2963,16 @@ get_mem_map(void)
 	 * dumped system.
 	 */
 	if (!is_xen_memory()) {
+		unsigned int valid_memmap = 0;
 		for (i = 0; i < info->num_mem_map; i++) {
 			if (info->mem_map_data[i].mem_map == NOT_MEMMAP_ADDR)
 				continue;
 			max_pfn = MAX(max_pfn, info->mem_map_data[i].pfn_end);
+			valid_memmap++;
+		}
+		if (valid_memmap) {
+			info->max_mapnr = MIN(info->max_mapnr, max_pfn);
 		}
-		info->max_mapnr = MIN(info->max_mapnr, max_pfn);
 	}
 	return ret;
 }
-- 
1.7.1



[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