On Wed, Mar 05, 2014 at 11:17:57AM +0800, Baoquan He wrote:
kdump now dumps vmcore to root partition by default in SAVE_PATCH
directory, e.g /var/crash defaultly. This is problematic when another
disk is mounted on /var or /var/crash, because the saved vmcore will
he hidden after dump in 1st kernel. This also has the potential of
blindly filling the root file system without a clue as to why.
Now fix this by failing the loading of kdump kernel if dump target
is root fs by default while different disk is mounted on save path.
Signed-off-by: Baoquan He <bhe(a)redhat.com>
This one looks good to me.
Acked-by: Vivek Goyal <vgoyal(a)redhat.com>
Thanks
Vivek
---
mkdumprd | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/mkdumprd b/mkdumprd
index f7d2f4d..fe2c86b 100644
--- a/mkdumprd
+++ b/mkdumprd
@@ -355,6 +355,28 @@ get_block_dump_target()
[ -b "$_target" ] && echo $(to_dev_name $_target)
}
+# If no dump disk is specified make sure /var/crash is not mounted on a
+# separate disk.
+check_block_dump_target()
+{
+ local _target
+ local _mntpoint
+
+ _target=$(get_user_configured_dump_disk)
+ [ -n "$_target" ] && return
+
+ _target=$(get_root_fs_device)
+ if [ -b "$_target" ]; then
+ mkdir -p $SAVE_PATH
+ _mntpoint=`df $SAVE_PATH | tail -1 | awk '{print $NF}'`
+ if [ "$_mntpoint" != "/" ]; then
+ perror "No dump target specified. Default dump target is rootfs block
device."
+ perror "But dump path $SAVE_PATH is not backed by rootfs block device.
"
+ perror_exit "Either explicitly specify a dump target or specify a dump
path backed by rootfs block device"
+ fi
+ fi
+}
+
get_default_action_target()
{
local _target
@@ -478,6 +500,8 @@ check_crypt()
return 1
}
+check_block_dump_target
+
if ! check_resettable; then
exit 1
fi
--
1.8.3.1
_______________________________________________
kexec mailing list
kexec(a)lists.fedoraproject.org
https://lists.fedoraproject.org/mailman/listinfo/kexec