[PATCH V2] kdump: print a message in case parse_crashkernel_mem resulted in zero bytes

Dave Young dyoung at redhat.com
Tue Nov 14 00:01:29 PST 2017


In parse_crashkernel_mem, it silently return in case we get zero
bytes in the parsing function.  It is useful for debugging for
adding a message especially sometimes kernel can not boot
up 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.

Signed-off-by: Dave Young <dyoung at redhat.com>
---
[v1 -> v2]: bhsharma: pr_warn looks confusing because of return 0
 kernel/crash_core.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- linux-x86.orig/kernel/crash_core.c
+++ linux-x86/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;
 }



More information about the kexec mailing list