Skip to contentSkip to conversation

kdump: print a message in case parse_crashkernel_mem resulted in zero bytes

PATCH New [email protected] 1 participant 1 message Nov 17, 2017 Kdump

lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

PATCH 67/94 kdump: print a message in case parse_crashkernel_mem resulted in zero bytes

From: Dave Young <[email protected]>
Subject: kdump: print a message in case parse_crashkernel_mem resulted in zero bytes

parse_crashkernel_mem() silently returns if we get zero bytes in the parsing function. It is useful for debugging to add a message, especially if the kernel cannot boot correctly.

Add a pr_info instead of pr_warn because it is expected behavior for size = 0, eg. crashkernel=2G-4G:128M, size will be 0 in case system memory is less than 2G.

---

 kernel/crash_core.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
kernel/crash_core.c renamed from kernel/crash_core.c~kdump-print-a-message-in-case-parse_crashkernel_mem-resulted-in-zero-bytes +2 -1
diff -puN kernel/crash_core.c~kdump-print-a-message-in-case-parse_crashkernel_mem-resulted-in-zero-bytes kernel/crash_core.c
@@ -108,7 +108,8 @@ static int __init parse_crashkernel_mem(
 				return -EINVAL;
 			}
 		}
-	}
+	} else
+		pr_info("crashkernel size resulted in zero bytes\n");
 
 	return 0;
 }

_