File kdump-do-not-free-fadump-memory-when-immediate-reboot-is-requested.patch of Package kdump.17334

From: Michal Suchanek <msuchanek@suse.de>
Date: Wed Jun 21 15:25:49 2017 +0200
Subject: Do not free fadump memory when reboot is requested
References: bsc#1040610
Upstream: v0.8.17
Git-commit: 653f8c0931c638cbb0bd5c22fc0e1dfd7969b29a

Freeing fadump memory can take a long time and doing it when we are going to
reboot anyway is pointless.

In bsc#1034169 a kernel oops is triggered by freeing fadump memory killing
save_dump.sh and preventing the reboot requested by the user from happening
entirely.

Avoid the issue and speed up reboot by not freeing fadump memory when reboot is
requested.

Signed-off-by: Michal Suchanek <msuchanek@suse.de>

--- kdump-0.8.16/init/save_dump.sh~	2017-06-16 13:59:02.017110055 +0200
+++ kdump-0.8.16/init/save_dump.sh	2017-06-16 13:59:35.629621303 +0200
@@ -49,7 +49,8 @@
 
     if fadump_enabled; then
         # release memory if possible
-        test -f $FADUMP_RELEASE_MEM && echo 1 > $FADUMP_RELEASE_MEM
+        [ -f $FADUMP_RELEASE_MEM -a $KDUMP_IMMEDIATE_REBOOT != "yes" \
+                -a "$KDUMP_IMMEDIATE_REBOOT" != "YES" ] && echo 1 > $FADUMP_RELEASE_MEM
         if [ "$KDUMP_FADUMP_SHELL" = "yes" \
                 -o "$KDUMP_FADUMP_SHELL" = "YES" ] ; then
             echo
openSUSE Build Service is sponsored by