Currently, crash utility faces different behaviors on reading zero pages that are filtered out on the kdump-compressed format originating from kdump ELF and from sadump formats: the former succeeds in reading zero pages but the latter fails. This is a design bug. To fix this issue, perform zero pages filtering explicitly if some pages are filtered out. Signed-off-by: Takao Indoh <indou.takao at jp.fujitsu.com> Signed-off-by: HATAYAMA Daisuke <d.hatayama at jp.fujitsu.com> --- sadump_info.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/sadump_info.c b/sadump_info.c index e30b802..63d00c6 100644 --- a/sadump_info.c +++ b/sadump_info.c @@ -878,6 +878,21 @@ sadump_initialize_bitmap_memory(void) bmp->offset = si->sub_hdr_offset + sh->block_size * sh->sub_hdr_size; si->ram_bitmap = bmp; + /* + * Perform explicitly zero filtering. Without this processing + * crash utility faces different behaviors on reading zero + * pages that are filtered out on the kdump-compressed format + * originating from kdump ELF and from sadump formats: the + * former succeeds in reading zero pages but the latter fails. + */ + for (pfn = 0; pfn < si->max_mapnr; pfn++) { + if (sadump_is_ram(pfn) && + !sadump_is_dumpable(info->bitmap_memory, pfn)) { + info->dump_level |= DL_EXCLUDE_ZERO; + break; + } + } + return TRUE; } @@ -1053,9 +1068,8 @@ readpage_sadump(unsigned long long paddr, void *bufptr) } if (!sadump_is_dumpable(info->bitmap_memory, pfn)) { - ERRMSG("pfn(%llx) is excluded from %s.\n", pfn, - info->name_memory); - return FALSE; + memset(bufptr, 0, info->page_size); + return TRUE; } block = pfn_to_block(pfn); -- 1.9.3