From b034968220525d108650ffd0f0ecb11825a347fc Mon Sep 17 00:00:00 2001 From: Coiby Xu Date: Thu, 9 Oct 2025 16:51:36 +0800 Subject: [PATCH] Address CPU/memory hot plugging for kdump LUKS support Resolves: https://issues.redhat.com/browse/RHEL-104940 Conflict: None commit 9de617170ad9bac97db53a2bf031e895fb482dba Author: Coiby Xu Date: Wed Jun 25 11:26:53 2025 +0800 Address CPU/memory hot plugging for kdump LUKS support We can reuse LUKS volume keys when there is CPU/memory hot plugging by writing 1 to /sys/kernel/config/crash_dm_crypt_keys/resue to reuse keys already saved to kdump reserved memory. Signed-off-by: Coiby Xu Signed-off-by: Coiby Xu --- kdump-udev-throttler | 13 +++++++++++++ kdumpctl | 3 +++ 2 files changed, 16 insertions(+) diff --git a/kdump-udev-throttler b/kdump-udev-throttler index 4b9896a..208599e 100755 --- a/kdump-udev-throttler +++ b/kdump-udev-throttler @@ -15,6 +15,17 @@ throttle_lock="/var/lock/kdump-udev-throttle" +LUKS_CONFIGFS_REUSE=/sys/kernel/config/crash_dm_crypt_keys/reuse +reuse_luks_keys() +{ + [[ -f $LUKS_CONFIGFS_REUSE ]] || echo 1 > $LUKS_CONFIGFS_REUSE +} + +unuse_luks_keys() +{ + + [[ -f $LUKS_CONFIGFS_REUSE ]] || echo 0 > $LUKS_CONFIGFS_REUSE +} exec 9> $throttle_lock if [ $? -ne 0 ]; then echo "Failed to create the lock file! Fallback to non-throttled kdump service restart" @@ -37,6 +48,8 @@ sleep 1 && udevadm settle --timeout 3 # holding two locks at the same time and we might miss some events exec 9>&- +reuse_luks_keys /bin/kdumpctl reload +unuse_luks_keys exit 0 diff --git a/kdumpctl b/kdumpctl index 860ca57..7434d17 100755 --- a/kdumpctl +++ b/kdumpctl @@ -1106,6 +1106,9 @@ prepare_luks() return 1 fi + # For the case of CPU/memory hotplugging, we can reuse loaded keys + [[ $(cat $LUKS_CONFIGFS/reuse) == 1 ]] && return 0 + for _luks_dev in "${_luks_devs[@]}"; do _devuuid=$(maj_min_to_uuid "$_luks_dev") _key_dir=$LUKS_CONFIGFS/$_devuuid