Address CPU/memory hot plugging for kdump LUKS support
Resolves: https://issues.redhat.com/browse/RHEL-104940 Conflict: None commit 9de617170ad9bac97db53a2bf031e895fb482dba Author: Coiby Xu <coxu@redhat.com> 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 <coxu@redhat.com> Signed-off-by: Coiby Xu <coxu@redhat.com>
This commit is contained in:
parent
f1ee3f6e22
commit
b034968220
@ -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
|
||||
|
||||
3
kdumpctl
3
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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user