[Crash-utility] [PATCH 2/5] diskdump, zram: initialize zram symbol information when needed

HATAYAMA Daisuke d.hatayama at fujitsu.com
Sun Oct 11 01:34:35 UTC 2020


In the current code, symbol information related to zram is initialized
even when a given disk is not zram. It should be done after the disk
turns out to be zram.

Signed-off-by: HATAYAMA Daisuke <d.hatayama at fujitsu.com>
---
 diskdump.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/diskdump.c b/diskdump.c
index dcc7142..047d8ad 100644
--- a/diskdump.c
+++ b/diskdump.c
@@ -2719,9 +2719,6 @@ try_zram_decompress(ulonglong pte_val, unsigned char *buf, ulong len, ulonglong
 	unsigned char *zram_buf = NULL;
 	unsigned char *outbuf = NULL;
 
-	if (INVALID_MEMBER(zram_compressor))
-		zram_init();
-
 	off = PAGEOFFSET(vaddr);
 	if (!symbol_exists("swap_info"))
 		return 0;
@@ -2752,6 +2749,9 @@ try_zram_decompress(ulonglong pte_val, unsigned char *buf, ulong len, ulonglong
 		return 0;
 	}
 
+	if (INVALID_MEMBER(zram_compressor))
+		zram_init();
+
 	if (CRASHDEBUG(2))
 		error(WARNING, "this page has swapped to zram\n");
 
-- 
1.8.3.1




More information about the Crash-utility mailing list