[Crash-utility] [PATCH v2 4/7] diskname, zram: Notify necessity of loading zram module

HATAYAMA Daisuke d.hatayama at fujitsu.com
Fri Dec 25 06:48:47 UTC 2020


By the previous commit, trying to read swapped-out-into-zram-disk
pages results in inaccessible memory error that is apparently
irrelevant to zram and users cannot find it necessary to load zram
module. Thus, let's add a warning message to indicate that as follows:

  crash> rd -u 0x7f520626e000
  WARNING: Some pages are swapped out to zram. Please run mod -s zram.
  rd: invalid user virtual address: 7f520626e000  type: "64-bit UVADDR"

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

diff --git a/diskdump.c b/diskdump.c
index 587b45c..143ac3c 100644
--- a/diskdump.c
+++ b/diskdump.c
@@ -2757,8 +2757,13 @@ try_zram_decompress(ulonglong pte_val, unsigned char *buf, ulong len, ulonglong
 
 	if (INVALID_MEMBER(zram_compressor)) {
 		zram_init();
-		if (INVALID_MEMBER(zram_compressor))
+		if (INVALID_MEMBER(zram_compressor)) {
+			error(WARNING,
+			      "Some pages are swapped out to zram. "
+			      "Please run mod -s zram.\n",
+			      name);
 			return 0;
+		}
 	}
 
 	if (CRASHDEBUG(2))
-- 
1.8.3.1




More information about the Crash-utility mailing list