Kexec-tools should be able to recognize if a dump target is reformatted, or dump path mounts another device.
Changes since v5: - Commit log improved - is_xxxx_modified() has been renamed as check_xxxx_modified(), because it is returning non-boolean values. - check_dump_fs_modified() logic has been simplified.
Changes since v5: - Couple of spellcheck in comments - name convert for $_target while discovering $_fstype - an extra "grep $_id" when dracut argument has "by-uuid" - No need to check if ssh/nfs/raw target is specified. We will fix such cases latter by introducing separate checks for them
Changes since v4: - patch 4/5 is a new change - patch 4/4 of V3 is now 4/5. There has been many modifications in this patch. It includes feedback from Baoquan and Xunlei. Have also done some modification to recognize changes related to minix and NFS filesystem as well. Infact, whole structure of function is_fs_uuid_changed() has been modified. Now it has been renamed as is_dump_fs_modified() to suit it better. Although I have tested it rigorously, but still a careful review of is_dump_fs_modified() will be helpful.
Changes since v3: - "$ret" unquoted - No message for "$system_modified" != "0" - image_time is now global - is_dump_target_modified has been renamed as is_fs_uuid_changed
Changes since v2: -- now is_system_modified returns 2 in case of invalid modification, 1 in case of valid modification and 0 in case of no modification. -- file modification check has been moved to is_system_modified now -- variables have been put under "" in if condition check
Changes since v1: -- Local variable is defined in shell function now -- raw target does not take persistent names "by-uuid" now -- dracut arguments grep is more robust -- When no UUID then warn and return
Pratyush Anand (5): mkdumprd: do not lookup in by-uuid dirs for raw device's persistent name kdumpctl: force rebuild in case of dynamic system modification kdumpctl: Move file modification check logic in check_system_modified() mkdumprd: move to_dev_name() & get_persistent_dev() to kdump-lib.sh kdumpctl: force rebuild in case of file system is modified
kdump-lib.sh | 49 ++++++++++++++++++++ kdumpctl | 144 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++--- mkdumprd | 47 +------------------ 3 files changed, 188 insertions(+), 52 deletions(-)
raw devices are not mounted and also does not need to contain any filesystem. So they may have UUIDs(when formatted) and may not have UUIDs when raw. Therefore, do not look for persistent names by-uuid for raw devices.
Signed-off-by: Pratyush Anand panand@redhat.com Suggested-by: Dave Young dyoung@redhat.com --- mkdumprd | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/mkdumprd b/mkdumprd index 6e3d9757f3d8..ad40d2872f98 100644 --- a/mkdumprd +++ b/mkdumprd @@ -30,14 +30,20 @@ perror() { }
get_persistent_dev() { - local i _tmp _dev + local i _tmp _dev _lookup_dirs
_dev=$(udevadm info --query=name --name="$1" 2>/dev/null) [ -z "$_dev" ] && { perror_exit "Kernel dev name of $1 is not found." }
- for i in /dev/mapper/* /dev/disk/by-uuid/* /dev/disk/by-id/*; do + if [[ $2 = "raw" ]];then + _lookup_dirs="/dev/mapper/* /dev/disk/by-id/*" + else + _lookup_dirs="/dev/mapper/* /dev/disk/by-uuid/* /dev/disk/by-id/*" + fi + + for i in $_lookup_dirs; do _tmp=$(udevadm info --query=name --name="$i" 2>/dev/null) if [ "$_tmp" = "$_dev" ]; then echo $i @@ -138,7 +144,7 @@ to_mount() { _mntopts="$_target $_fstype $_options" #for non-nfs _dev converting to use udev persistent name if [ -b "$_source" ]; then - _pdev="$(get_persistent_dev $_source)" + _pdev="$(get_persistent_dev $_source $_fstype)" if [ $? -ne 0 ]; then return 1 fi @@ -565,7 +571,7 @@ do dd if=$config_val count=1 of=/dev/null > /dev/null 2>&1 || { perror_exit "Bad raw disk $config_val" } - _praw=$(get_persistent_dev $config_val) + _praw=$(get_persistent_dev $config_val "raw") if [ $? -ne 0 ]; then exit 1 fi
There could be some dynamic system modification, which may affect kdump kernel boot process. In such situation initramfs must be rebuilt on the basis of changes. Since most of these checking methods will use information from TARGET_INITRD, therefore check its existence in common code.
Signed-off-by: Pratyush Anand panand@redhat.com --- kdumpctl | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+)
diff --git a/kdumpctl b/kdumpctl index 8ec6b2de914b..ea6ef7208d0f 100755 --- a/kdumpctl +++ b/kdumpctl @@ -327,10 +327,21 @@ setup_target_initrd() fi }
+# returns 0 if system is not modified +# returns 1 if system is modified +# returns 2 if system modification is invalid +check_system_modified() +{ + [[ -f $TARGET_INITRD ]] || return 1 + + return 0 +} + check_rebuild() { local extra_modules modified_files="" local _force_rebuild force_rebuild="0" + local ret system_modified="0" local initramfs_has_fadump
check_boot_dir @@ -388,6 +399,14 @@ check_rebuild() fi done
+ check_system_modified + ret=$? + if [ $ret -eq 2 ]; then + return 1 + elif [ $ret -eq 1 ];then + system_modified="1" + fi + #check if target initrd has fadump support if [ "$DEFAULT_DUMP_MODE" = "fadump" ] && [ -f "$TARGET_INITRD" ]; then initramfs_has_fadump=`lsinitrd -m $TARGET_INITRD | grep ^kdumpbase$ | wc -l` @@ -399,6 +418,8 @@ check_rebuild() echo "$TARGET_INITRD has no fadump support" elif [ "$force_rebuild" != "0" ]; then echo -n "Force rebuild $TARGET_INITRD"; echo + elif [ "$system_modified" != "0" ]; then + : elif [ -n "$modified_files" ]; then echo "Detected change(s) in the following file(s):" echo -n " "; echo "$modified_files" | sed 's/\s/\n /g'
Relevant kdump files are also part of system. Therefore, moving logic of file modification checking in check_system_modified() function now.
No functional changes.
Signed-off-by: Pratyush Anand panand@redhat.com --- kdumpctl | 49 ++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 42 insertions(+), 7 deletions(-)
diff --git a/kdumpctl b/kdumpctl index ea6ef7208d0f..2ce7651bcc62 100755 --- a/kdumpctl +++ b/kdumpctl @@ -14,6 +14,7 @@ FADUMP_ENABLED_SYS_NODE="/sys/kernel/fadump_enabled" FADUMP_REGISTER_SYS_NODE="/sys/kernel/fadump_registered" #kdump shall be the default dump mode DEFAULT_DUMP_MODE="kdump" +image_time=0
. /lib/kdump/kdump-lib.sh
@@ -275,7 +276,6 @@ check_config() # return list of modified file for fence_kdump modified in Pacemaker cluster get_pcs_cluster_modified_files() { - local image_time=$1 local time_stamp local modified_files
@@ -327,19 +327,59 @@ setup_target_initrd() fi }
+check_files_modified() +{ + local modified_files="" + + #also rebuild when Pacemaker cluster conf is changed and fence kdump is enabled. + modified_files=$(get_pcs_cluster_modified_files) + + EXTRA_BINS=`grep ^kdump_post $KDUMP_CONFIG_FILE | cut -d\ -f2` + CHECK_FILES=`grep ^kdump_pre $KDUMP_CONFIG_FILE | cut -d\ -f2` + EXTRA_BINS="$EXTRA_BINS $CHECK_FILES" + CHECK_FILES=`grep ^extra_bins $KDUMP_CONFIG_FILE | cut -d\ -f2-` + EXTRA_BINS="$EXTRA_BINS $CHECK_FILES" + files="$KDUMP_CONFIG_FILE $kdump_kernel $EXTRA_BINS /etc/fstab" + + check_exist "$files" && check_executable "$EXTRA_BINS" + [ $? -ne 0 ] && return 2 + + for file in $files; do + time_stamp=`stat -c "%Y" $file` + if [ "$time_stamp" -gt "$image_time" ]; then + modified_files="$modified_files $file" + fi + done + if [ -n "$modified_files" ]; then + echo "Detected change(s) in the following file(s):" + echo -n " "; echo "$modified_files" | sed 's/\s/\n /g' + return 1 + fi + + return 0 +} + # returns 0 if system is not modified # returns 1 if system is modified # returns 2 if system modification is invalid check_system_modified() { + local ret + [[ -f $TARGET_INITRD ]] || return 1
+ check_files_modified + ret=$? + if [ $ret -ne 0 ]; then + return $ret + fi + return 0 }
check_rebuild() { - local extra_modules modified_files="" + local extra_modules local _force_rebuild force_rebuild="0" local ret system_modified="0" local initramfs_has_fadump @@ -375,8 +415,6 @@ check_rebuild() #since last build of the image file if [ -f $TARGET_INITRD ]; then image_time=`stat -c "%Y" $TARGET_INITRD 2>/dev/null` - else - image_time=0 fi
#also rebuild when Pacemaker cluster conf is changed and fence kdump is enabled. @@ -420,9 +458,6 @@ check_rebuild() echo -n "Force rebuild $TARGET_INITRD"; echo elif [ "$system_modified" != "0" ]; then : - elif [ -n "$modified_files" ]; then - echo "Detected change(s) in the following file(s):" - echo -n " "; echo "$modified_files" | sed 's/\s/\n /g' else return 0 fi
to_dev_name() and get_persistent_dev() can be used by function in kdumpctl. Therefore moving them to kdump-lib.sh.
No functional changes.
Signed-off-by: Pratyush Anand panand@redhat.com
fix with to_dev_name
Signed-off-by: Pratyush Anand panand@redhat.com --- kdump-lib.sh | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ mkdumprd | 49 ------------------------------------------------- 2 files changed, 49 insertions(+), 49 deletions(-)
diff --git a/kdump-lib.sh b/kdump-lib.sh index 4d3420652b2f..fc2c03602614 100755 --- a/kdump-lib.sh +++ b/kdump-lib.sh @@ -7,6 +7,15 @@ DEFAULT_PATH="/var/crash/" FENCE_KDUMP_CONFIG_FILE="/etc/sysconfig/fence_kdump" FENCE_KDUMP_SEND="/usr/libexec/fence_kdump_send"
+perror_exit() { + echo $@ >&2 + exit 1 +} + +perror() { + echo $@ >&2 +} + is_ssh_dump_target() { grep -q "^ssh[[:blank:]].*@" /etc/kdump.conf @@ -63,6 +72,46 @@ is_generic_fence_kdump() grep -q "^fence_kdump_nodes" /etc/kdump.conf }
+to_dev_name() { + local dev="${1//"/}" + + case "$dev" in + UUID=*) + dev=`blkid -U "${dev#UUID=}"` + ;; + LABEL=*) + dev=`blkid -L "${dev#LABEL=}"` + ;; + esac + echo $dev +} + +get_persistent_dev() { + local i _tmp _dev _lookup_dirs + + _dev=$(udevadm info --query=name --name="$1" 2>/dev/null) + [ -z "$_dev" ] && { + perror_exit "Kernel dev name of $1 is not found." + } + + if [[ $2 = "raw" ]];then + _lookup_dirs="/dev/mapper/* /dev/disk/by-id/*" + else + _lookup_dirs="/dev/mapper/* /dev/disk/by-uuid/* /dev/disk/by-id/*" + fi + + for i in $_lookup_dirs; do + _tmp=$(udevadm info --query=name --name="$i" 2>/dev/null) + if [ "$_tmp" = "$_dev" ]; then + echo $i + return + fi + done + + perror "WARNING: Persistent device name of $1 not found. Using $1 as dump target name" + echo $1 +} + get_user_configured_dump_disk() { local _target diff --git a/mkdumprd b/mkdumprd index ad40d2872f98..78afb1a9425d 100644 --- a/mkdumprd +++ b/mkdumprd @@ -20,41 +20,6 @@ extra_modules="" dracut_args=("--hostonly" "-o" "plymouth dash resume ifcfg") OVERRIDE_RESETTABLE=0
-perror_exit() { - echo $@ >&2 - exit 1 -} - -perror() { - echo $@ >&2 -} - -get_persistent_dev() { - local i _tmp _dev _lookup_dirs - - _dev=$(udevadm info --query=name --name="$1" 2>/dev/null) - [ -z "$_dev" ] && { - perror_exit "Kernel dev name of $1 is not found." - } - - if [[ $2 = "raw" ]];then - _lookup_dirs="/dev/mapper/* /dev/disk/by-id/*" - else - _lookup_dirs="/dev/mapper/* /dev/disk/by-uuid/* /dev/disk/by-id/*" - fi - - for i in $_lookup_dirs; do - _tmp=$(udevadm info --query=name --name="$i" 2>/dev/null) - if [ "$_tmp" = "$_dev" ]; then - echo $i - return - fi - done - - perror "WARNING: Persistent device name of $1 not found. Using $1 as dump target name" - echo $1 -} - add_dracut_arg() { local arg qarg is_quoted=0 while [ $# -gt 0 ]; @@ -331,20 +296,6 @@ check_block_and_slaves() { return 1 }
-to_dev_name() { - local dev="${1//"/}" - - case "$dev" in - UUID=*) - dev=`blkid -U "${dev#UUID=}"` - ;; - LABEL=*) - dev=`blkid -L "${dev#LABEL=}"` - ;; - esac - echo $dev -} - get_block_dump_target() { local _target
kdumpctl passes --device argument if dump target is a raw device. It passes --mount argument if dump target is either mounted as nfs or as a bulk device. When dump target device is a root device then it does not pass any of the above two arguments.
After kdumpctl restart, if there is any change in file system which needs different dracut arguments, then initramfs must be rebuild.
Modification in filesystem for a raw target does not affect dracut arguments. So, we do not consider to check any modification if raw target was specified in kdump.conf.
We might need to change dracut arguments if there is some changes in nfs and ssh target related files. However, we do not consider them in this patch.
We mainly consider changes in bulk target specified in kdump.conf. We also consider changes in bulk and nfs file system, if there was no dump target specified in kdump.conf but dump path is mounting such file systems.
So the initramfs must be rebuild if, either dump target's persistent path or it's mount point or its file system type changes. If there is no dump target specified then, both dump path and root path must mount same device, otherwise rebuild should be triggered.
Some of the examples when we can need a rebuild:
-- "dump target" is specified as one of ext[234], xfs or btrfs. But after kdump initramfs building its UUID is changed by reformatting. -- "dump target" is specified as file system type fs1 (say ext3). But after kdump initramfs building, user change it to fs2 (say ext4), probably by a mkfs.ext4 executing on the target device. -- "dump target" is not specified, but "dump path" mounts a device which is different than device for root path and either UUID or file system type is modified after kdump initramfs build. -- "dump target" is not specified, but "dump path" mounts a nfs device and nfs host path changes after kdump initramfs build.
Some testing:
Initial conditions: -- No dump target specified -- dump path (/var/crash) and root(/) are on same device -- kdumpctl was already executed once after last modification in /etc/kdump.conf
# kdumpctl restart No rebuild # mkfs.ext2 /dev/md0;mount /dev/md0 /var/crash/;kdumpctl restart Rebuilt because "Detected change in File System" # kdumpctl restart No rebuild # umount /var/crash/;kdumpctl restart Rebuilt because "Detected change in File System" # kdumpctl restart No rebuild # mount /dev/md0 /var/crash/;kdumpctl restart Rebuilt because "Detected change in File System" # umount /var/crash;mkfs.ext4 /dev/md0; # mount /dev/md0 /var/crash/;kdumpctl restart Rebuilt because "Detected change in File System"
# umount /var/crash;mkfs.ext4 /dev/mapper/fedora-swap # mount /dev/mapper/fedora-swap /var/crash/ # kdumpctl restart Rebuilt because "Detected change in File System" # umount /var/crash;mkfs.btrfs /dev/mapper/fedora-swap -f # mount /dev/mapper/fedora-swap /var/crash/ # kdumpctl restart Rebuilt because "Detected change in File System" # kdumpctl restart No rebuild # umount /var/crash/;kdumpctl restart Rebuilt because "Detected change in File System" # mount /dev/mapper/fedora-swap /var/crash/;kdumpctl restart Rebuilt because "Detected change in File System"
# umount /var/crash;mkfs.minix /dev/md0 # mount /dev/md0 /var/crash/; kdumpctl restart Rebuilt because "Detected change in File System" # kdumpctl restart No rebuild # umount /var/crash/;kdumpctl restart Rebuilt because "Detected change in File System"
# mount 192.168.1.16:/nfsroot /var/crash/;kdumpctl restart Rebuilt because "Detected change in File System" # umount /var/crash/;kdumpctl restart Rebuilt because "Detected change in File System" # mount 192.168.1.16:/nfsroot /var/crash/;kdumpctl restart Rebuilt because "Detected change in File System" # kdumpctl restart No rebuild # umount /var/crash;mount 192.168.1.12:/nfsroot /var/crash/ # kdumpctl restart Rebuilt because "Detected change in File System" # umount /var/crash/;kdumpctl restart Rebuilt because "Detected change in File System"
Added "raw /dev/md0" in /etc/kdump.conf # kdumpctl restart Rebuilt because "Detected change in /etc/kdump.conf" # mkfs.ext4 /dev/md0 ;kdumpctl restart No rebuild
Added "ext4 /dev/md0" in /etc/kdump.conf # mkfs.ext4 /dev/md0;mount /dev/md0 /mnt # mkdir /mnt/var;mkdir /mnt/var/crash; kdumpctl restart Rebuilt because "Detected change in /etc/kdump.conf" # umount /mnt;mkfs.ext4 /dev/md0;mount /dev/md0 /mnt # mkdir /mnt/var;mkdir /mnt/var/crash; kdumpctl restart Rebuilt because "Detected change in /etc/kdump.conf"
Most of the credits for this patch goes to Xunlei Pang xpang@redhat.com for suggesting several improvements.
Signed-off-by: Pratyush Anand panand@redhat.com --- kdumpctl | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+)
diff --git a/kdumpctl b/kdumpctl index 2ce7651bcc62..34b64f33ac40 100755 --- a/kdumpctl +++ b/kdumpctl @@ -359,6 +359,74 @@ check_files_modified() return 0 }
+check_dump_fs_modified() +{ + local _old_dev _old_mntpoint _old_fstype + local _new_dev _new_mntpoint _new_fstype + local _target _path _dracut_args + + # No need to check in case of raw target. + # Currently we do not check also if ssh/nfs target is specified + if is_ssh_dump_target || is_nfs_dump_target || is_raw_dump_target; then + return 0 + fi + + _target=$(get_user_configured_dump_disk) + + if [[ -n "$_target" ]]; then + _target=$(to_dev_name $_target) + _new_fstype=$(blkid $_target | awk -F"TYPE=" '{print $2}' | cut -d '"' -f 2) + else + _path=$(get_save_path) + set -- $(df -T $_path 2>/dev/null | tail -1 | awk '{ print $1, $2}') + _target=$(to_dev_name $1) + _new_fstype=$2 + if [[ -z "$_target" || -z "$_new_fstype" ]];then + echo "Dump path $_path does not exist" + return 2 + fi + fi + + if [[ $(expr substr $_new_fstype 1 3) = "nfs" ]];then + _new_dev=$_target + else + _new_dev=$(get_persistent_dev $_target $_new_fstype) + if ! findmnt $_target >/dev/null; then + echo "Dump target $_target is probably not mounted." + return 2 + fi + fi + + if ! findmnt $_target >/dev/null; then + echo "Dump target $_target is probably not mounted." + return 2 + fi + _new_mntpoint="/kdumproot/$(get_mntpoint_from_target $_target)" + + _dracut_args=$(lsinitrd $TARGET_INITRD | grep "^Arguments:" | head -1) + if [[ -z "$_dracut_args" ]];then + echo "Warning: No dracut arguments found in initrd" + return 0 + fi + + # if --mount argument present then match old and new target, mount + # point and file system. If any of them mismatches then rebuild + echo $_dracut_args | grep "--mount" &> /dev/null + if [[ $? -eq 0 ]];then + set -- $(echo $_dracut_args | awk -F "--mount '" '{print $2}' | cut -d' ' -f1,2,3) + _old_dev=$1 + _old_mntpoint=$2 + _old_fstype=$3 + [[ $_new_dev = $_old_dev && $_new_mntpoint = $_old_mntpoint && $_new_fstype = $_old_fstype ]] && return 0 + # otherwise rebuild if target device is not a root device + else + [[ "$_target" = "$(get_root_fs_device)" ]] && return 0 + fi + + echo "Detected change in File System" + return 1 +} + # returns 0 if system is not modified # returns 1 if system is modified # returns 2 if system modification is invalid @@ -374,6 +442,12 @@ check_system_modified() return $ret fi
+ check_dump_fs_modified + ret=$? + if [ $ret -ne 0 ]; then + return $ret + fi + return 0 }
Hi, Pratyush
On 05/09/16 at 01:47pm, Pratyush Anand wrote:
kdumpctl passes --device argument if dump target is a raw device. It passes --mount argument if dump target is either mounted as nfs or as a bulk device. When dump target device is a root device then it does not pass any of the above two arguments.
After kdumpctl restart, if there is any change in file system which needs different dracut arguments, then initramfs must be rebuild.
Modification in filesystem for a raw target does not affect dracut arguments. So, we do not consider to check any modification if raw target was specified in kdump.conf.
We might need to change dracut arguments if there is some changes in nfs and ssh target related files. However, we do not consider them in this patch.
We mainly consider changes in bulk target specified in kdump.conf. We also consider changes in bulk and nfs file system, if there was no dump target specified in kdump.conf but dump path is mounting such file systems.
So the initramfs must be rebuild if, either dump target's persistent path or it's mount point or its file system type changes. If there is no dump target specified then, both dump path and root path must mount same device, otherwise rebuild should be triggered.
Some of the examples when we can need a rebuild:
-- "dump target" is specified as one of ext[234], xfs or btrfs. But after kdump initramfs building its UUID is changed by reformatting. -- "dump target" is specified as file system type fs1 (say ext3). But after kdump initramfs building, user change it to fs2 (say ext4), probably by a mkfs.ext4 executing on the target device. -- "dump target" is not specified, but "dump path" mounts a device which is different than device for root path and either UUID or file system type is modified after kdump initramfs build. -- "dump target" is not specified, but "dump path" mounts a nfs device and nfs host path changes after kdump initramfs build.
Some testing:
Initial conditions: -- No dump target specified -- dump path (/var/crash) and root(/) are on same device -- kdumpctl was already executed once after last modification in /etc/kdump.conf
# kdumpctl restart No rebuild # mkfs.ext2 /dev/md0;mount /dev/md0 /var/crash/;kdumpctl restart Rebuilt because "Detected change in File System" # kdumpctl restart No rebuild # umount /var/crash/;kdumpctl restart Rebuilt because "Detected change in File System" # kdumpctl restart No rebuild # mount /dev/md0 /var/crash/;kdumpctl restart Rebuilt because "Detected change in File System" # umount /var/crash;mkfs.ext4 /dev/md0; # mount /dev/md0 /var/crash/;kdumpctl restart Rebuilt because "Detected change in File System"
# umount /var/crash;mkfs.ext4 /dev/mapper/fedora-swap # mount /dev/mapper/fedora-swap /var/crash/ # kdumpctl restart Rebuilt because "Detected change in File System" # umount /var/crash;mkfs.btrfs /dev/mapper/fedora-swap -f # mount /dev/mapper/fedora-swap /var/crash/ # kdumpctl restart Rebuilt because "Detected change in File System" # kdumpctl restart No rebuild # umount /var/crash/;kdumpctl restart Rebuilt because "Detected change in File System" # mount /dev/mapper/fedora-swap /var/crash/;kdumpctl restart Rebuilt because "Detected change in File System"
# umount /var/crash;mkfs.minix /dev/md0 # mount /dev/md0 /var/crash/; kdumpctl restart Rebuilt because "Detected change in File System" # kdumpctl restart No rebuild # umount /var/crash/;kdumpctl restart Rebuilt because "Detected change in File System"
# mount 192.168.1.16:/nfsroot /var/crash/;kdumpctl restart Rebuilt because "Detected change in File System" # umount /var/crash/;kdumpctl restart Rebuilt because "Detected change in File System" # mount 192.168.1.16:/nfsroot /var/crash/;kdumpctl restart Rebuilt because "Detected change in File System" # kdumpctl restart No rebuild # umount /var/crash;mount 192.168.1.12:/nfsroot /var/crash/ # kdumpctl restart Rebuilt because "Detected change in File System" # umount /var/crash/;kdumpctl restart Rebuilt because "Detected change in File System"
Added "raw /dev/md0" in /etc/kdump.conf # kdumpctl restart Rebuilt because "Detected change in /etc/kdump.conf" # mkfs.ext4 /dev/md0 ;kdumpctl restart No rebuild
Added "ext4 /dev/md0" in /etc/kdump.conf # mkfs.ext4 /dev/md0;mount /dev/md0 /mnt # mkdir /mnt/var;mkdir /mnt/var/crash; kdumpctl restart Rebuilt because "Detected change in /etc/kdump.conf" # umount /mnt;mkfs.ext4 /dev/md0;mount /dev/md0 /mnt # mkdir /mnt/var;mkdir /mnt/var/crash; kdumpctl restart Rebuilt because "Detected change in /etc/kdump.conf"
Most of the credits for this patch goes to Xunlei Pang xpang@redhat.com for suggesting several improvements.
Signed-off-by: Pratyush Anand panand@redhat.com
kdumpctl | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+)
diff --git a/kdumpctl b/kdumpctl index 2ce7651bcc62..34b64f33ac40 100755 --- a/kdumpctl +++ b/kdumpctl @@ -359,6 +359,74 @@ check_files_modified() return 0 }
+check_dump_fs_modified() +{
- local _old_dev _old_mntpoint _old_fstype
- local _new_dev _new_mntpoint _new_fstype
- local _target _path _dracut_args
- # No need to check in case of raw target.
- # Currently we do not check also if ssh/nfs target is specified
- if is_ssh_dump_target || is_nfs_dump_target || is_raw_dump_target; then
return 0
- fi
- _target=$(get_user_configured_dump_disk)
- if [[ -n "$_target" ]]; then
_target=$(to_dev_name $_target)
_new_fstype=$(blkid $_target | awk -F"TYPE=" '{print $2}' | cut -d '"' -f 2)
- else
_path=$(get_save_path)
set -- $(df -T $_path 2>/dev/null | tail -1 | awk '{ print $1, $2}')
_target=$(to_dev_name $1)
_new_fstype=$2
if [[ -z "$_target" || -z "$_new_fstype" ]];then
echo "Dump path $_path does not exist"
return 2
fi
- fi
- if [[ $(expr substr $_new_fstype 1 3) = "nfs" ]];then
_new_dev=$_target
- else
_new_dev=$(get_persistent_dev $_target $_new_fstype)
if ! findmnt $_target >/dev/null; then
echo "Dump target $_target is probably not mounted."
return 2
fi
- fi
if ! findmnt $_target >/dev/null; then
echo "Dump target $_target is probably not mounted."
return 2
fi
- _new_mntpoint="/kdumproot/$(get_mntpoint_from_target $_target)"
the _new_mntpoint is for the real mount target dir name, we do not need to care about it?
Thanks Dave
- _dracut_args=$(lsinitrd $TARGET_INITRD | grep "^Arguments:" | head -1)
- if [[ -z "$_dracut_args" ]];then
echo "Warning: No dracut arguments found in initrd"
return 0
- fi
- # if --mount argument present then match old and new target, mount
- # point and file system. If any of them mismatches then rebuild
- echo $_dracut_args | grep "--mount" &> /dev/null
- if [[ $? -eq 0 ]];then
set -- $(echo $_dracut_args | awk -F "--mount '" '{print $2}' | cut -d' ' -f1,2,3)
_old_dev=$1
_old_mntpoint=$2
_old_fstype=$3
[[ $_new_dev = $_old_dev && $_new_mntpoint = $_old_mntpoint && $_new_fstype = $_old_fstype ]] && return 0
- # otherwise rebuild if target device is not a root device
- else
[[ "$_target" = "$(get_root_fs_device)" ]] && return 0
- fi
- echo "Detected change in File System"
- return 1
+}
# returns 0 if system is not modified # returns 1 if system is modified # returns 2 if system modification is invalid @@ -374,6 +442,12 @@ check_system_modified() return $ret fi
- check_dump_fs_modified
- ret=$?
- if [ $ret -ne 0 ]; then
return $ret
- fi
- return 0
}
-- 2.5.5
Hi Dave,
On 09/05/2016:06:09:07 PM, Dave Young wrote:
Hi, Pratyush
On 05/09/16 at 01:47pm, Pratyush Anand wrote:
kdumpctl passes --device argument if dump target is a raw device. It passes --mount argument if dump target is either mounted as nfs or as a bulk device. When dump target device is a root device then it does not pass any of the above two arguments.
After kdumpctl restart, if there is any change in file system which needs different dracut arguments, then initramfs must be rebuild.
Modification in filesystem for a raw target does not affect dracut arguments. So, we do not consider to check any modification if raw target was specified in kdump.conf.
We might need to change dracut arguments if there is some changes in nfs and ssh target related files. However, we do not consider them in this patch.
We mainly consider changes in bulk target specified in kdump.conf. We also consider changes in bulk and nfs file system, if there was no dump target specified in kdump.conf but dump path is mounting such file systems.
So the initramfs must be rebuild if, either dump target's persistent path or it's mount point or its file system type changes. If there is no dump target specified then, both dump path and root path must mount same device, otherwise rebuild should be triggered.
Some of the examples when we can need a rebuild:
-- "dump target" is specified as one of ext[234], xfs or btrfs. But after kdump initramfs building its UUID is changed by reformatting. -- "dump target" is specified as file system type fs1 (say ext3). But after kdump initramfs building, user change it to fs2 (say ext4), probably by a mkfs.ext4 executing on the target device. -- "dump target" is not specified, but "dump path" mounts a device which is different than device for root path and either UUID or file system type is modified after kdump initramfs build. -- "dump target" is not specified, but "dump path" mounts a nfs device and nfs host path changes after kdump initramfs build.
Some testing:
Initial conditions: -- No dump target specified -- dump path (/var/crash) and root(/) are on same device -- kdumpctl was already executed once after last modification in /etc/kdump.conf
# kdumpctl restart No rebuild # mkfs.ext2 /dev/md0;mount /dev/md0 /var/crash/;kdumpctl restart Rebuilt because "Detected change in File System" # kdumpctl restart No rebuild # umount /var/crash/;kdumpctl restart Rebuilt because "Detected change in File System" # kdumpctl restart No rebuild # mount /dev/md0 /var/crash/;kdumpctl restart Rebuilt because "Detected change in File System" # umount /var/crash;mkfs.ext4 /dev/md0; # mount /dev/md0 /var/crash/;kdumpctl restart Rebuilt because "Detected change in File System"
# umount /var/crash;mkfs.ext4 /dev/mapper/fedora-swap # mount /dev/mapper/fedora-swap /var/crash/ # kdumpctl restart Rebuilt because "Detected change in File System" # umount /var/crash;mkfs.btrfs /dev/mapper/fedora-swap -f # mount /dev/mapper/fedora-swap /var/crash/ # kdumpctl restart Rebuilt because "Detected change in File System" # kdumpctl restart No rebuild # umount /var/crash/;kdumpctl restart Rebuilt because "Detected change in File System" # mount /dev/mapper/fedora-swap /var/crash/;kdumpctl restart Rebuilt because "Detected change in File System"
# umount /var/crash;mkfs.minix /dev/md0 # mount /dev/md0 /var/crash/; kdumpctl restart Rebuilt because "Detected change in File System" # kdumpctl restart No rebuild # umount /var/crash/;kdumpctl restart Rebuilt because "Detected change in File System"
# mount 192.168.1.16:/nfsroot /var/crash/;kdumpctl restart Rebuilt because "Detected change in File System" # umount /var/crash/;kdumpctl restart Rebuilt because "Detected change in File System" # mount 192.168.1.16:/nfsroot /var/crash/;kdumpctl restart Rebuilt because "Detected change in File System" # kdumpctl restart No rebuild # umount /var/crash;mount 192.168.1.12:/nfsroot /var/crash/ # kdumpctl restart Rebuilt because "Detected change in File System" # umount /var/crash/;kdumpctl restart Rebuilt because "Detected change in File System"
Added "raw /dev/md0" in /etc/kdump.conf # kdumpctl restart Rebuilt because "Detected change in /etc/kdump.conf" # mkfs.ext4 /dev/md0 ;kdumpctl restart No rebuild
Added "ext4 /dev/md0" in /etc/kdump.conf # mkfs.ext4 /dev/md0;mount /dev/md0 /mnt # mkdir /mnt/var;mkdir /mnt/var/crash; kdumpctl restart Rebuilt because "Detected change in /etc/kdump.conf" # umount /mnt;mkfs.ext4 /dev/md0;mount /dev/md0 /mnt # mkdir /mnt/var;mkdir /mnt/var/crash; kdumpctl restart Rebuilt because "Detected change in /etc/kdump.conf"
Most of the credits for this patch goes to Xunlei Pang xpang@redhat.com for suggesting several improvements.
Signed-off-by: Pratyush Anand panand@redhat.com
kdumpctl | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+)
diff --git a/kdumpctl b/kdumpctl index 2ce7651bcc62..34b64f33ac40 100755 --- a/kdumpctl +++ b/kdumpctl @@ -359,6 +359,74 @@ check_files_modified() return 0 }
+check_dump_fs_modified() +{
- local _old_dev _old_mntpoint _old_fstype
- local _new_dev _new_mntpoint _new_fstype
- local _target _path _dracut_args
- # No need to check in case of raw target.
- # Currently we do not check also if ssh/nfs target is specified
- if is_ssh_dump_target || is_nfs_dump_target || is_raw_dump_target; then
return 0
- fi
- _target=$(get_user_configured_dump_disk)
- if [[ -n "$_target" ]]; then
_target=$(to_dev_name $_target)
_new_fstype=$(blkid $_target | awk -F"TYPE=" '{print $2}' | cut -d '"' -f 2)
- else
_path=$(get_save_path)
set -- $(df -T $_path 2>/dev/null | tail -1 | awk '{ print $1, $2}')
_target=$(to_dev_name $1)
_new_fstype=$2
if [[ -z "$_target" || -z "$_new_fstype" ]];then
echo "Dump path $_path does not exist"
return 2
fi
- fi
- if [[ $(expr substr $_new_fstype 1 3) = "nfs" ]];then
_new_dev=$_target
- else
_new_dev=$(get_persistent_dev $_target $_new_fstype)
if ! findmnt $_target >/dev/null; then
echo "Dump target $_target is probably not mounted."
return 2
fi
- fi
if ! findmnt $_target >/dev/null; then
echo "Dump target $_target is probably not mounted."
return 2
fi
- _new_mntpoint="/kdumproot/$(get_mntpoint_from_target $_target)"
the _new_mntpoint is for the real mount target dir name, we do not need to care about it?
Actually mntpoint is also passed as an argument to Dracut. So, we do the rebuild if there is a change needed into that.
For example: # egrep -v "^#" /etc/kdump.conf
ext4 /dev/md0 path /var/crash core_collector makedumpfile -l --message-level 1 -d 31 -F
# mount /dev/md0 /mnt/ # lsinitrd /boot/initramfs-4.5.0-302.fc24.x86_64+debugkdump.img | grep "Arguments" Arguments: --hostonly -o 'plymouth dash resume ifcfg' --mount '/dev/disk/by-uuid/d249a4ec-0603-49d0-8d6b-a19314081f35 /kdumproot//mnt ext4 rw,relatime,seclabel,stripe=256,data=ordered,x-initrd.mount' -f
Now mount /dev/md0 to another directory.
# umount /mnt;mount /dev/md0 /dump/;kdumpctl restart # lsinitrd /boot/initramfs-4.5.0-302.fc24.x86_64+debugkdump.img | grep # "Arguments" Arguments: --hostonly -o 'plymouth dash resume ifcfg' --mount '/dev/disk/by-uuid/d249a4ec-0603-49d0-8d6b-a19314081f35 /kdumproot//dump ext4 rw,relatime,seclabel,stripe=256,data=ordered,x-initrd.mount' -f
So, here we did not do any change in kdump.conf, however when mount target dir is changed, dracut is passed with different arguments (if rebuild).
So, IMHO we should rebuild if any condition is triggered which may cause change in mntpoint dracut argument.
~Pratyush
Thanks Dave
- _dracut_args=$(lsinitrd $TARGET_INITRD | grep "^Arguments:" | head -1)
- if [[ -z "$_dracut_args" ]];then
echo "Warning: No dracut arguments found in initrd"
return 0
- fi
- # if --mount argument present then match old and new target, mount
- # point and file system. If any of them mismatches then rebuild
- echo $_dracut_args | grep "--mount" &> /dev/null
- if [[ $? -eq 0 ]];then
set -- $(echo $_dracut_args | awk -F "--mount '" '{print $2}' | cut -d' ' -f1,2,3)
_old_dev=$1
_old_mntpoint=$2
_old_fstype=$3
[[ $_new_dev = $_old_dev && $_new_mntpoint = $_old_mntpoint && $_new_fstype = $_old_fstype ]] && return 0
- # otherwise rebuild if target device is not a root device
- else
[[ "$_target" = "$(get_root_fs_device)" ]] && return 0
- fi
- echo "Detected change in File System"
- return 1
+}
# returns 0 if system is not modified # returns 1 if system is modified # returns 2 if system modification is invalid @@ -374,6 +442,12 @@ check_system_modified() return $ret fi
- check_dump_fs_modified
- ret=$?
- if [ $ret -ne 0 ]; then
return $ret
- fi
- return 0
}
-- 2.5.5
Actually mntpoint is also passed as an argument to Dracut. So, we do the rebuild if there is a change needed into that.
For example: # egrep -v "^#" /etc/kdump.conf
ext4 /dev/md0 path /var/crash core_collector makedumpfile -l --message-level 1 -d 31 -F
# mount /dev/md0 /mnt/ # lsinitrd /boot/initramfs-4.5.0-302.fc24.x86_64+debugkdump.img | grep "Arguments" Arguments: --hostonly -o 'plymouth dash resume ifcfg' --mount '/dev/disk/by-uuid/d249a4ec-0603-49d0-8d6b-a19314081f35 /kdumproot//mnt ext4 rw,relatime,seclabel,stripe=256,data=ordered,x-initrd.mount' -f
Now mount /dev/md0 to another directory.
# umount /mnt;mount /dev/md0 /dump/;kdumpctl restart # lsinitrd /boot/initramfs-4.5.0-302.fc24.x86_64+debugkdump.img | grep # "Arguments" Arguments: --hostonly -o 'plymouth dash resume ifcfg' --mount '/dev/disk/by-uuid/d249a4ec-0603-49d0-8d6b-a19314081f35 /kdumproot//dump ext4 rw,relatime,seclabel,stripe=256,data=ordered,x-initrd.mount' -f
So, here we did not do any change in kdump.conf, however when mount target dir is changed, dracut is passed with different arguments (if rebuild).
So, IMHO we should rebuild if any condition is triggered which may cause change in mntpoint dracut argument.
Pratyush, I got your points, it make sense.
I was just confused why using /dev/md0 as an example because one should always use persistent device names for dm/lvm devices.
We do not need to fix it if it is only for /dev/md*, but as you said it also fit for /dev/mapper/* device nodes so the changes will be fine.
Thanks Dave
On 05/09/16 at 01:47pm, Pratyush Anand wrote:
+check_dump_fs_modified() +{
- local _old_dev _old_mntpoint _old_fstype
- local _new_dev _new_mntpoint _new_fstype
- local _target _path _dracut_args
- # No need to check in case of raw target.
- # Currently we do not check also if ssh/nfs target is specified
- if is_ssh_dump_target || is_nfs_dump_target || is_raw_dump_target; then
return 0
- fi
- _target=$(get_user_configured_dump_disk)
- if [[ -n "$_target" ]]; then
_target=$(to_dev_name $_target)
_new_fstype=$(blkid $_target | awk -F"TYPE=" '{print $2}' | cut -d '"' -f 2)
- else
_path=$(get_save_path)
set -- $(df -T $_path 2>/dev/null | tail -1 | awk '{ print $1, $2}')
Well, this is a new way I learned.
_target=$(to_dev_name $1)
_new_fstype=$2
if [[ -z "$_target" || -z "$_new_fstype" ]];then
echo "Dump path $_path does not exist"
return 2
fi
- fi
- if [[ $(expr substr $_new_fstype 1 3) = "nfs" ]];then
This is interesting too. If I do I will use [[ "$_new_fstype" = *nfs* ]] way which is frequently used in dracut code. Study expr usage again when I review this patch.
Except of these new shell skills which I can't get at the first glance, everything looks great.
Ack this series. Thanks for the effort!
Thanks Baoquan
_new_dev=$_target
- else
_new_dev=$(get_persistent_dev $_target $_new_fstype)
if ! findmnt $_target >/dev/null; then
echo "Dump target $_target is probably not mounted."
return 2
fi
- fi
if ! findmnt $_target >/dev/null; then
echo "Dump target $_target is probably not mounted."
return 2
fi
- _new_mntpoint="/kdumproot/$(get_mntpoint_from_target $_target)"
- _dracut_args=$(lsinitrd $TARGET_INITRD | grep "^Arguments:" | head -1)
- if [[ -z "$_dracut_args" ]];then
echo "Warning: No dracut arguments found in initrd"
return 0
- fi
- # if --mount argument present then match old and new target, mount
- # point and file system. If any of them mismatches then rebuild
- echo $_dracut_args | grep "--mount" &> /dev/null
- if [[ $? -eq 0 ]];then
set -- $(echo $_dracut_args | awk -F "--mount '" '{print $2}' | cut -d' ' -f1,2,3)
_old_dev=$1
_old_mntpoint=$2
_old_fstype=$3
[[ $_new_dev = $_old_dev && $_new_mntpoint = $_old_mntpoint && $_new_fstype = $_old_fstype ]] && return 0
- # otherwise rebuild if target device is not a root device
- else
[[ "$_target" = "$(get_root_fs_device)" ]] && return 0
- fi
- echo "Detected change in File System"
- return 1
+}
# returns 0 if system is not modified # returns 1 if system is modified # returns 2 if system modification is invalid @@ -374,6 +442,12 @@ check_system_modified() return $ret fi
- check_dump_fs_modified
- ret=$?
- if [ $ret -ne 0 ]; then
return $ret
- fi
- return 0
}
-- 2.5.5 _______________________________________________ kexec mailing list kexec@lists.fedoraproject.org http://lists.fedoraproject.org/admin/lists/kexec@lists.fedoraproject.org
On 2016/05/09 at 16:17, Pratyush Anand wrote:
Kexec-tools should be able to recognize if a dump target is reformatted, or dump path mounts another device.
Changes since v5:
- Commit log improved
- is_xxxx_modified() has been renamed as check_xxxx_modified(), because it is returning non-boolean values.
- check_dump_fs_modified() logic has been simplified.
Changes since v5:
- Couple of spellcheck in comments
- name convert for $_target while discovering $_fstype
- an extra "grep $_id" when dracut argument has "by-uuid"
- No need to check if ssh/nfs/raw target is specified. We will fix such cases latter by introducing separate checks for them
Changes since v4:
- patch 4/5 is a new change
- patch 4/4 of V3 is now 4/5. There has been many modifications in this patch. It includes feedback from Baoquan and Xunlei. Have also done some
modification to recognize changes related to minix and NFS filesystem as well. Infact, whole structure of function is_fs_uuid_changed() has been modified. Now it has been renamed as is_dump_fs_modified() to suit it better. Although I have tested it rigorously, but still a careful review of is_dump_fs_modified() will be helpful.
Changes since v3:
- "$ret" unquoted
- No message for "$system_modified" != "0"
- image_time is now global
- is_dump_target_modified has been renamed as is_fs_uuid_changed
Changes since v2: -- now is_system_modified returns 2 in case of invalid modification, 1 in case of valid modification and 0 in case of no modification. -- file modification check has been moved to is_system_modified now -- variables have been put under "" in if condition check
Changes since v1: -- Local variable is defined in shell function now -- raw target does not take persistent names "by-uuid" now -- dracut arguments grep is more robust -- When no UUID then warn and return
Pratyush Anand (5): mkdumprd: do not lookup in by-uuid dirs for raw device's persistent name kdumpctl: force rebuild in case of dynamic system modification kdumpctl: Move file modification check logic in check_system_modified() mkdumprd: move to_dev_name() & get_persistent_dev() to kdump-lib.sh kdumpctl: force rebuild in case of file system is modified
kdump-lib.sh | 49 ++++++++++++++++++++ kdumpctl | 144 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++--- mkdumprd | 47 +------------------ 3 files changed, 188 insertions(+), 52 deletions(-)
For the series, Acked-by: Xunlei Pang xlpang@redhat.com
Hi, Pratyush
Since Baoquan is still reviewing it, I will hold on to merge this series, will wait until he finished the review.
Thanks Dave
On 05/10/16 at 10:19am, Xunlei Pang wrote:
On 2016/05/09 at 16:17, Pratyush Anand wrote:
Kexec-tools should be able to recognize if a dump target is reformatted, or dump path mounts another device.
Changes since v5:
- Commit log improved
- is_xxxx_modified() has been renamed as check_xxxx_modified(), because it is returning non-boolean values.
- check_dump_fs_modified() logic has been simplified.
Changes since v5:
- Couple of spellcheck in comments
- name convert for $_target while discovering $_fstype
- an extra "grep $_id" when dracut argument has "by-uuid"
- No need to check if ssh/nfs/raw target is specified. We will fix such cases latter by introducing separate checks for them
Changes since v4:
- patch 4/5 is a new change
- patch 4/4 of V3 is now 4/5. There has been many modifications in this patch. It includes feedback from Baoquan and Xunlei. Have also done some
modification to recognize changes related to minix and NFS filesystem as well. Infact, whole structure of function is_fs_uuid_changed() has been modified. Now it has been renamed as is_dump_fs_modified() to suit it better. Although I have tested it rigorously, but still a careful review of is_dump_fs_modified() will be helpful.
Changes since v3:
- "$ret" unquoted
- No message for "$system_modified" != "0"
- image_time is now global
- is_dump_target_modified has been renamed as is_fs_uuid_changed
Changes since v2: -- now is_system_modified returns 2 in case of invalid modification, 1 in case of valid modification and 0 in case of no modification. -- file modification check has been moved to is_system_modified now -- variables have been put under "" in if condition check
Changes since v1: -- Local variable is defined in shell function now -- raw target does not take persistent names "by-uuid" now -- dracut arguments grep is more robust -- When no UUID then warn and return
Pratyush Anand (5): mkdumprd: do not lookup in by-uuid dirs for raw device's persistent name kdumpctl: force rebuild in case of dynamic system modification kdumpctl: Move file modification check logic in check_system_modified() mkdumprd: move to_dev_name() & get_persistent_dev() to kdump-lib.sh kdumpctl: force rebuild in case of file system is modified
kdump-lib.sh | 49 ++++++++++++++++++++ kdumpctl | 144 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++--- mkdumprd | 47 +------------------ 3 files changed, 188 insertions(+), 52 deletions(-)
For the series, Acked-by: Xunlei Pang xlpang@redhat.com _______________________________________________ kexec mailing list kexec@lists.fedoraproject.org http://lists.fedoraproject.org/admin/lists/kexec@lists.fedoraproject.org
On 05/11/16 at 02:50pm, Dave Young wrote:
Hi, Pratyush
Since Baoquan is still reviewing it, I will hold on to merge this series, will wait until he finished the review.
Hi Dave,
I have acked this series in my latest comments. It may contain too many sentences so that the ack is not apparent. So feel free to merge it.
Thanks Baoquan
Thanks Dave
On 05/10/16 at 10:19am, Xunlei Pang wrote:
On 2016/05/09 at 16:17, Pratyush Anand wrote:
Kexec-tools should be able to recognize if a dump target is reformatted, or dump path mounts another device.
Changes since v5:
- Commit log improved
- is_xxxx_modified() has been renamed as check_xxxx_modified(), because it is returning non-boolean values.
- check_dump_fs_modified() logic has been simplified.
Changes since v5:
- Couple of spellcheck in comments
- name convert for $_target while discovering $_fstype
- an extra "grep $_id" when dracut argument has "by-uuid"
- No need to check if ssh/nfs/raw target is specified. We will fix such cases latter by introducing separate checks for them
Changes since v4:
- patch 4/5 is a new change
- patch 4/4 of V3 is now 4/5. There has been many modifications in this patch. It includes feedback from Baoquan and Xunlei. Have also done some
modification to recognize changes related to minix and NFS filesystem as well. Infact, whole structure of function is_fs_uuid_changed() has been modified. Now it has been renamed as is_dump_fs_modified() to suit it better. Although I have tested it rigorously, but still a careful review of is_dump_fs_modified() will be helpful.
Changes since v3:
- "$ret" unquoted
- No message for "$system_modified" != "0"
- image_time is now global
- is_dump_target_modified has been renamed as is_fs_uuid_changed
Changes since v2: -- now is_system_modified returns 2 in case of invalid modification, 1 in case of valid modification and 0 in case of no modification. -- file modification check has been moved to is_system_modified now -- variables have been put under "" in if condition check
Changes since v1: -- Local variable is defined in shell function now -- raw target does not take persistent names "by-uuid" now -- dracut arguments grep is more robust -- When no UUID then warn and return
Pratyush Anand (5): mkdumprd: do not lookup in by-uuid dirs for raw device's persistent name kdumpctl: force rebuild in case of dynamic system modification kdumpctl: Move file modification check logic in check_system_modified() mkdumprd: move to_dev_name() & get_persistent_dev() to kdump-lib.sh kdumpctl: force rebuild in case of file system is modified
kdump-lib.sh | 49 ++++++++++++++++++++ kdumpctl | 144 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++--- mkdumprd | 47 +------------------ 3 files changed, 188 insertions(+), 52 deletions(-)
For the series, Acked-by: Xunlei Pang xlpang@redhat.com _______________________________________________ kexec mailing list kexec@lists.fedoraproject.org http://lists.fedoraproject.org/admin/lists/kexec@lists.fedoraproject.org
On 05/11/16 at 03:50pm, Baoquan He wrote:
On 05/11/16 at 02:50pm, Dave Young wrote:
Hi, Pratyush
Since Baoquan is still reviewing it, I will hold on to merge this series, will wait until he finished the review.
Hi Dave,
I have acked this series in my latest comments. It may contain too many sentences so that the ack is not apparent. So feel free to merge it.
Ok, thanks, I did not notice it..
Hi, Pratyush
Applied the series.
Thanks Dave