Don't unmount the dump target just after saving vmcore

Since commit 6dee286467 ("Don't mount the dump target unless needed"),
dump_fs function unmounts the dump target just after saving vmcore.

This broke the condition that it's mounted when executing "kdump_post",
which had been stable since RHEL5, and a certain tool which uses the
kdump_post hook to save information of 2nd kernel to the dump target
started to fail.

As unmounting it is done by systemd-shutdown before reboot without
the umount command as below, so let's don't unmount it in dump_fs.

  systemd-shutdown[1]: Unmounting file systems.
  [547]: Remounting '/sysroot' read-only in with options '(null)'.
  EXT4-fs (dm-0): re-mounted. Opts: (null)
  [548]: Unmounting '/sysroot'.

Signed-off-by: Kazuhito Hagio <k-hagio-ab@nec.com>
Acked-by: Kairui Song <kasong@redhat.com>
This commit is contained in:
Kazuhito Hagio 2020-04-20 19:03:24 +00:00 committed by Kairui Song
parent f33f30eb61
commit 74081a2b64
1 changed files with 0 additions and 6 deletions

View File

@ -97,7 +97,6 @@ get_kdump_confs()
# dump_fs <mount point| device>
dump_fs()
{
local _do_umount=""
local _dev=$(findmnt -k -f -n -r -o SOURCE $1)
local _mp=$(findmnt -k -f -n -r -o TARGET $1)
local _op=$(findmnt -k -f -n -r -o OPTIONS $1)
@ -116,7 +115,6 @@ dump_fs()
echo "kdump: mounting failed (mount point: $_mp, option: $_op)"
return 1
fi
_do_umount=1
else
echo "kdump: error: Dump target $_dev is not usable"
fi
@ -147,10 +145,6 @@ dump_fs()
echo "kdump: saving vmcore complete"
if [ $_do_umount ]; then
umount $_mp || echo "kdump: warn: failed to umount target"
fi
# improper kernel cmdline can cause the failure of echo, we can ignore this kind of failure
return 0
}