[PATCH] makedumpfile: call initial before use cache
Lichen Liu
lichliu at redhat.com
Mon Jun 24 18:57:12 PDT 2024
Run 'makedumpfile --mem-usage /proc/kcore' will coredump on ppc64, it is
because show_mem_usage()->get_page_offset()->get_versiondep_info_ppc64()
->readmem() use cache before it is inited by initial().
Currently only ppc64 has this issue because only
get_versiondep_info_ppc64() call readmem().
Signed-off-by: Lichen Liu <lichliu at redhat.com>
---
makedumpfile.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/makedumpfile.c b/makedumpfile.c
index 5b34712..6a42264 100644
--- a/makedumpfile.c
+++ b/makedumpfile.c
@@ -12019,6 +12019,9 @@ int show_mem_usage(void)
DEBUG_MSG("Read vmcoreinfo from NOTE segment: %d\n", vmcoreinfo);
}
+ if (!initial())
+ return FALSE;
+
if (!get_page_offset())
return FALSE;
@@ -12034,9 +12037,6 @@ int show_mem_usage(void)
return FALSE;
}
- if (!initial())
- return FALSE;
-
if (!open_dump_bitmap())
return FALSE;
--
2.44.0
More information about the kexec
mailing list