From 4b33d8059543099d32c6adef70fcb64a2c509f6e Mon Sep 17 00:00:00 2001 From: Vasily Gorbik Date: Thu, 5 Apr 2018 16:49:29 +0200 Subject: [PATCH] chreipl: correct fcp reipl sysfs write sequence MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit kdump reipl implementation relies on os_info kernel structure residing in old memory being dumped. os_info contains reipl block, which is used (if valid) by the kdump kernel for reipl parameters. The problem is that the reipl block and its checksum inside os_info is updated only when /sys/firmware/reipl/reipl_type is written. This sets an offset of a reipl block for "reipl_type" and re-calculates reipl block checksum. Any further alteration of values under /sys/firmware/reipl/{reipl_type}/ without subsequent write to /sys/firmware/reipl/reipl_type lead to incorrect os_info reipl block checksum. In such a case kdump kernel ignores it and reboots using default logic. This change makes sure that all fcp values are written before reipl_type, to avoid potential problem with incorrect checksum. Reviewed-by: Heiko Carstens Signed-off-by: Vasily Gorbik Signed-off-by: Jan Höppner --- ipl_tools/cmd_chreipl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ipl_tools/cmd_chreipl.c b/ipl_tools/cmd_chreipl.c index 75fa3980..89a2e7b8 100644 --- a/ipl_tools/cmd_chreipl.c +++ b/ipl_tools/cmd_chreipl.c @@ -636,7 +636,6 @@ static void chreipl_fcp(void) write_str(l.busid, "reipl/fcp/device"); write_str(l.wwpn, "reipl/fcp/wwpn"); write_str(l.lun, "reipl/fcp/lun"); - write_str("fcp", "reipl/reipl_type"); /* * set the boot record logical block address. Master boot * record. It is always 0 for Linux @@ -645,6 +644,7 @@ static void chreipl_fcp(void) if (!l.bootprog_set) sprintf(l.bootprog, "0"); write_str(l.bootprog, "reipl/fcp/bootprog"); + write_str("fcp", "reipl/reipl_type"); print_fcp(0, 0); }