From 5221d4b90cd90aa8319a32ec090a6c4ce94b3667 Mon Sep 17 00:00:00 2001 From: Bhupesh Sharma Date: Mon, 21 May 2018 10:31:46 +0530 Subject: [PATCH] kdumpctl: Remove 'netroot' and 'iscsi initiator' entries from kdump cmdline In a iSCSI multipath environment (which uses iSCSI software initiator and target environment) when the vmcore file is saved on the target, kdump always fails to establish a iSCSI session and also fails to collect dump due to duplicate entries for 'netroot' and 'iscsi initiator' in the kdump bootargs: # echo c > /proc/sysrq-trigger [83471.842707] SysRq : Trigger a crash [83471.843233] BUG: unable to handle kernel NULL pointer dereference at (null) [83471.844155] IP: [] sysrq_handle_crash+0x16/0x20 [83471.844931] PGD 800000023f710067 PUD 229fd6067 PMD 0 [83471.845655] Oops: 0002 [#1] SMP [83471.861889] Call Trace: [83471.862162] [] __handle_sysrq+0x10d/0x170 [83471.862771] [] write_sysrq_trigger+0x2f/0x40 [83471.863405] [] proc_reg_write+0x40/0x80 [83471.863984] [] vfs_write+0xc0/0x1f0 [83471.864536] [] SyS_write+0x7f/0xf0 [83471.865075] [] system_call_fastpath+0x1c/0x21 [83471.865714] Code: eb 9b 45 01 f4 45 39 65 34 75 e5 4c 89 ef e8 e2 f7 ff ff eb db 0f 1f 44 00 00 55 48 89 e5 c7 05 41 47 81 00 01 00 00 00 0f ae f8 04 25 00 00 00 00 01 5d c3 0f 1f 44 00 00 55 31 c0 c7 05 be [83471.868888] RIP [] sysrq_handle_crash+0x16/0x20 [83471.869700] RSP [83471.870074] CR2: 0000000000000000 Starting Login iSCSI Target iqn.2014-08.com.example:t1... [ OK ] Stopped Login iSCSI Target iqn.2014-08.com.example:t1. Starting Login iSCSI Target iqn.2014-08.com.example:t1... [ 6.607051] scsi host2: iSCSI Initiator over TCP/IP [FAILED] Failed to start Login iSCSI Target iqn.2014-08.com.example:t1. See 'systemctl status "iscsistart_\\x40...com.example:t1.service"' for details. [ 126.572911] dracut-initqueue[243]: Warning: dracut-initqueue timeout - starting timeout scripts Stopping Open-iSCSI... [ OK ] Stopped Open-iSCSI. Starting Open-iSCSI... [ OK ] Started Open-iSCSI. Starting Login iSCSI Target iqn.2014-08.com.example:t1... [ OK ] Stopped Login iSCSI Target iqn.2014-08.com.example:t1. Starting Login iSCSI Target iqn.2014-08.com.example:t1... [ 131.095897] scsi host3: iSCSI Initiator over TCP/IP [FAILED] Failed to start Login iSCSI Target iqn.2014-08.com.example:t1. See 'systemctl status "iscsistart_\\x40...com.example:t1.service"' for details. [ 251.085029] dracut-initqueue[243]: Warning: dracut-initqueue timeout - starting timeout scripts [ 251.594554] dracut-initqueue[243]: Warning: dracut-initqueue timeout - starting timeout scripts This patch fixes the same by removing the 'netroot', 'rd.iscsi.initiator' and 'iscsi_initiator' entries from the kdump boot cmdline. One reason why this is safe is our kdump target setup does not depend on 1st kernel inherited cmdline params now since the work we dropped root dependency. Signed-off-by: Bhupesh Sharma Acked-by: Dave Young --- kdumpctl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/kdumpctl b/kdumpctl index 1279d72..9a673c5 100755 --- a/kdumpctl +++ b/kdumpctl @@ -138,6 +138,11 @@ prepare_cmdline() # With the help of "--hostonly-cmdline", we can avoid some interitage. cmdline=$(remove_cmdline_param "$cmdline" rd.lvm.lv rd.luks.uuid rd.dm.uuid rd.md.uuid fcoe) + # Remove netroot, rd.iscsi.initiator and iscsi_initiator since + # we get duplicate entries for the same in case iscsi code adds + # it as well. + cmdline=$(remove_cmdline_param "$cmdline" netroot rd.iscsi.initiator iscsi_initiator) + cmdline="${cmdline} ${KDUMP_COMMANDLINE_APPEND}" id=$(get_bootcpu_apicid)