Re: [PATCH] makedumpfile: fix max_mapnr issue on system has over 44-bit addressing

Atsushi Kumagai
2013-10-02T06:23:58Z

Hello Jingbai,

I have a additional comment.

(2013/09/25 17:54), Jingbai Ma wrote:
> On 09/25/2013 04:39 PM, HATAYAMA Daisuke wrote:
>> (2013/09/25 17:16), Jingbai Ma wrote:
>> <cut>
> @@ -790,7 +794,7 @@ get_kdump_compressed_header_info(char *filename)
> DEBUG_MSG(" block_size : %d\n", dh.block_size);
> DEBUG_MSG(" sub_hdr_size : %d\n", dh.sub_hdr_size);
> DEBUG_MSG(" bitmap_blocks : %d\n", dh.bitmap_blocks);
> - DEBUG_MSG(" max_mapnr : 0x%x\n", dh.max_mapnr);
> + DEBUG_MSG(" max_mapnr(32bit) : 0x%x\n", dh.max_mapnr);
> DEBUG_MSG(" total_ram_blocks : %d\n", dh.total_ram_blocks);
> DEBUG_MSG(" device_blocks : %d\n", dh.device_blocks);
> DEBUG_MSG(" written_blocks : %d\n", dh.written_blocks);
> @@ -802,6 +806,7 @@ get_kdump_compressed_header_info(char *filename)
> DEBUG_MSG(" split : %d\n", kh.split);
> DEBUG_MSG(" start_pfn : 0x%lx\n", kh.start_pfn);
> DEBUG_MSG(" end_pfn : 0x%lx\n", kh.end_pfn);
> + DEBUG_MSG(" max_mapnr(64bit) : 0x%lx\n", kh.max_mapnr);

max_mapnr(64bit) will be included only in header_version 6 and later,
but your code shows that in any version.
I think it's better to change the code like below:

diff --git a/makedumpfile.c b/makedumpfile.c
index 069a903..6c20e88 100644
--- a/makedumpfile.c
+++ b/makedumpfile.c
@@ -847,6 +847,10 @@ get_kdump_compressed_header_info(char *filename)
(unsigned long long)kh.offset_eraseinfo);
DEBUG_MSG(" size_eraseinfo : 0x%ld\n", kh.size_eraseinfo);
}
+ if (dh.header_version >= 6) {
+ /* A dumpfile contains full 64bit max_mapnr. */
+ DEBUG_MSG(" max_mapnr(64bit) : 0x%llx\n", kh.max_mapnr);
+ }
return TRUE;
error:
free(info->dh_memory);

Thanks
Atsushi Kumagai