From 7f0ca4aa736981fea66a5f49adbf34a3348e9f6d340c67dc74c08593583bf02d Mon Sep 17 00:00:00 2001 From: Michal Suchanek Date: Mon, 4 Dec 2017 15:38:38 +0000 Subject: [PATCH] Accepting request 548154 from home:michals - kdump-Dont-exit-even-if-initrd-is-not-built.patch: fadump restart does not always rebuild initramfs but may need to re-register (bsc#1047781). - kdump-Limit-kdump-cpus-to-number-provided-by-config.patch (bsc#1036223, bsc#1068234). - kdump-Don-t-split-by-default.patch (bsc#1036223, bsc#1068234). OBS-URL: https://build.opensuse.org/request/show/548154 OBS-URL: https://build.opensuse.org/package/show/Kernel:kdump/kdump?expand=0&rev=140 --- kdump-Don-t-split-by-default.patch | 45 ++++++++++++++++ ...ont-exit-even-if-initrd-is-not-built.patch | 50 +++++++++++++++++ ...mp-cpus-to-number-provided-by-config.patch | 53 +++++++++++++++++++ kdump.changes | 8 +++ kdump.spec | 6 +++ 5 files changed, 162 insertions(+) create mode 100644 kdump-Don-t-split-by-default.patch create mode 100644 kdump-Dont-exit-even-if-initrd-is-not-built.patch create mode 100644 kdump-Limit-kdump-cpus-to-number-provided-by-config.patch diff --git a/kdump-Don-t-split-by-default.patch b/kdump-Don-t-split-by-default.patch new file mode 100644 index 0000000..591795f --- /dev/null +++ b/kdump-Don-t-split-by-default.patch @@ -0,0 +1,45 @@ +From 51a68c31497d1895602d5c6851e23a9027d9675d Mon Sep 17 00:00:00 2001 +From: Ankit Kumar +Date: Thu, 10 Aug 2017 15:04:32 +0530 +Subject: [PATCH] Don't split by default + +References: bsc#1036223, bsc#1068234 +Patch-mainline: v0.8.17 +Git-commit: 51a68c31497d1895602d5c6851e23a9027d9675d + +Currently, we are default'ing to "SPILT" as well as multi-threading +when KDUMPTOOL_FLAGS="". Ensure split is enabled only when it is set +explicitly with KDUMPTOOL_FLAGS="SPLIT". + +Signed-off-by: Ankit Kumar +--- + kdumptool/savedump.cc | 11 ++++------- + 1 file changed, 4 insertions(+), 7 deletions(-) + +diff --git a/kdumptool/savedump.cc b/kdumptool/savedump.cc +index ec66e63bd29b..e832bf98b762 100644 +--- a/kdumptool/savedump.cc ++++ b/kdumptool/savedump.cc +@@ -294,15 +294,12 @@ void SaveDump::saveDump(const RootDirURLVector &urlv) + if (cpus > online_cpus) + cpus = online_cpus; + } +- if (!config->kdumptoolContainsFlag("NOSPLIT") && +- !config->kdumptoolContainsFlag("SINGLE") && ++ if (!config->kdumptoolContainsFlag("SINGLE") && + cpus > 1) { +- if (!useElf) +- m_split = cpus; +- else +- cerr << "Splitting ELF dumps is not supported." << endl; + +- if (config->kdumptoolContainsFlag("SPLIT")) { ++ /* The check for NOSPLIT is for backward compatibility */ ++ if (config->kdumptoolContainsFlag("SPLIT") && ++ !config->kdumptoolContainsFlag("NOSPLIT")) { + if (!useElf) + m_split = cpus; + else +-- +2.13.6 + diff --git a/kdump-Dont-exit-even-if-initrd-is-not-built.patch b/kdump-Dont-exit-even-if-initrd-is-not-built.patch new file mode 100644 index 0000000..b57a4ec --- /dev/null +++ b/kdump-Dont-exit-even-if-initrd-is-not-built.patch @@ -0,0 +1,50 @@ +From 086068496508087b68029ae31a93ed5d3e4ac2cb Mon Sep 17 00:00:00 2001 +From: Ankit Kumar +Date: Mon, 7 Aug 2017 20:35:04 +0530 +Subject: [PATCH] Don't exit even if initrd is not built + +References: bsc#1047781 +Patch-mainline: v0.8.17 +Git-commit: 086068496508087b68029ae31a93ed5d3e4ac2cb + +In case where there is no change in kdump config, new initrd won't be +built. Restarting kdump.service in above case exits as initrd is same +as older. As control doesn't proceed further, it fails to enable dump +configuration. + +This patch fixes above mentioned issue by proceeding further and enabling +dump configuration. + +Signed-off-by: Ankit Kumar +Acked-by: Michal Suchanek +--- + init/load.sh | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +diff --git a/init/load.sh b/init/load.sh +index 4fc7a82e7199..6910bc546d9c 100755 +--- a/init/load.sh ++++ b/init/load.sh +@@ -309,13 +309,13 @@ if [ "$1" = "--update" ] ; then + rebuild_kdumprd || exit 1 + after=$(stat -c %Y $kdump_initrd) + +- # If the initial ram disk was not updated, +- # do not execute kexec again. This script +- # is called from kdump.service and ++ # This script is called from kdump.service and + # kdump-rebuild-initrd.service. +- if [ "$before" = "$after" ] ; then +- exit 0 +- fi ++ # Proceed further even if there is no change in initrd ++ # because restart kdump.service unloads kdump/fadump and ++ # in next service start below enablement will be required ++ # otherwise kdump/fadump won't be enabled and leads to panic ++ # on crash. + fi + + if [ "$KDUMP_FADUMP" = "yes" ] ; then +-- +2.13.6 + diff --git a/kdump-Limit-kdump-cpus-to-number-provided-by-config.patch b/kdump-Limit-kdump-cpus-to-number-provided-by-config.patch new file mode 100644 index 0000000..531e2a1 --- /dev/null +++ b/kdump-Limit-kdump-cpus-to-number-provided-by-config.patch @@ -0,0 +1,53 @@ +From 4fc281692f5bef9a23c603a37e7a1bc30ee0a855 Mon Sep 17 00:00:00 2001 +From: Ankit Kumar +Date: Thu, 10 Aug 2017 09:43:47 +0530 +Subject: [PATCH] Limit kdump cpus to number provided by config + +References: bsc#1036223, bsc#1068234 +Patch-mainline: v0.8.17 +Git-commit: 4fc281692f5bef9a23c603a37e7a1bc30ee0a855 + +Current piece of code doesn't verify number of kdump cpus provided in +config with number of online cpus and uses all online cpus as kdump cpus +even if KDUMP_CPUS are provided in the config. +Current code: +If online cpus = 5 and KDUMP_CPUS = 2 , then current piece of code +considers all online cpus as kdump cpus which is 5 but as KDUMP_CPUS +is provided as 2, we should restrict makedumpfile to use KDUMP_CPUS +which is 2 in this case. + +In case of kdump, as we use maxcpus=1 and hence online cpus remains 1 +but in case of fadump all cpus are online and even after providing +KDUMP_CPUS=1 in config, it consider all online cpus as kdump cpus. + +This patch fixes above issue by verifying KDUMP_CPUS with online cpus. +If KDUMP_CPUS > online cpus then only use online cpus as kdump +cpus else use KDUMP_CPUS as dump cpus. + +Signed-off-by: Ankit Kumar +--- + kdumptool/savedump.cc | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/kdumptool/savedump.cc b/kdumptool/savedump.cc +index a2fb1589d9db..ec66e63bd29b 100644 +--- a/kdumptool/savedump.cc ++++ b/kdumptool/savedump.cc +@@ -286,9 +286,13 @@ void SaveDump::saveDump(const RootDirURLVector &urlv) + return; // nothing to be done + + unsigned long cpus = config->KDUMP_CPUS.value(); ++ unsigned long online_cpus = 0; + if (cpus) { + SystemCPU syscpu; +- cpus = syscpu.numOnline(); ++ online_cpus = syscpu.numOnline(); ++ /* Limit kdump cpus to online cpus if (KDUMP_CPUS > online cpus) */ ++ if (cpus > online_cpus) ++ cpus = online_cpus; + } + if (!config->kdumptoolContainsFlag("NOSPLIT") && + !config->kdumptoolContainsFlag("SINGLE") && +-- +2.13.6 + diff --git a/kdump.changes b/kdump.changes index d579fec..fe5a3ee 100644 --- a/kdump.changes +++ b/kdump.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Wed Nov 15 12:25:57 UTC 2017 - msuchanek@suse.com + +- kdump-Dont-exit-even-if-initrd-is-not-built.patch: fadump restart does not + always rebuild initramfs but may need to re-register (bsc#1047781). +- kdump-Limit-kdump-cpus-to-number-provided-by-config.patch (bsc#1036223, bsc#1068234). +- kdump-Don-t-split-by-default.patch (bsc#1036223, bsc#1068234). + ------------------------------------------------------------------- Thu Jun 29 16:31:26 UTC 2017 - ptesarik@suse.com diff --git a/kdump.spec b/kdump.spec index d85fa2a..1a902d4 100644 --- a/kdump.spec +++ b/kdump.spec @@ -67,6 +67,9 @@ Patch22: %{name}-multithreading-by-default.patch Patch23: %{name}-explicitly-request-zFCP-devices.patch Patch24: %{name}-fail-if-fadump-cannot-be-registered.patch Patch25: %{name}-activate-QETH-devices.patch +Patch26: %{name}-Dont-exit-even-if-initrd-is-not-built.patch +Patch27: %{name}-Limit-kdump-cpus-to-number-provided-by-config.patch +Patch28: %{name}-Don-t-split-by-default.patch BuildRequires: asciidoc BuildRequires: cmake BuildRequires: gcc-c++ @@ -152,6 +155,9 @@ cp %{S:1} tests/data/ %patch23 -p1 %patch24 -p1 %patch25 -p1 +%patch26 -p1 +%patch27 -p1 +%patch28 -p1 %build export CFLAGS="%{optflags}"