Skip to contentSkip to conversation

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

PATCH Applied Dave Young 1 participant 1 message Nov 14, 2017

Subsystems (3)
lore
Share & tools
lore

Dave Young

author
#0 lore raw

PATCH v2 1/1 kdump: print a message in case parse_crashkernel_mem resulted in zero bytes

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.

---
[v1 -> v2]: bhsharma: pr_warn looks confusing because of return 0

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