kexec-tools/SOURCES/orabug33822070-kdump-skip-lvm-private-devices.patch

42 lines
1.3 KiB
Diff

kdump: Skip LVM private devices
Orabug: 33822070
Orabug: 33574003
As per the commit 20e1c3dc0339 ("libblkid: ignore private LVM devices") in
util-linux, the virtual private LVM devices do not contain any blkid relevant data
and it does not make any sense to scan for superblocks or partitions
on the devices.
The blkid command is expected to fail if it is run on these LVM devices. This
change skips the scanning of LVM private metadata devices when scanning for
underlying crypt devices.
Signed-off-by: Somasundaram Krishnasamy <somasundaram.krishnasamy@oracle.com>
Signed-off-by: John Donnelly <john.p.donnelly@oracle.com>
kdump-lib.sh | 7 +++++++
1 file changed, 7 insertions(+)
--- a/kdump-lib.sh 2022-10-10 15:26:42.287897779 -0400
+++ b/kdump-lib.sh 2022-10-10 15:27:51.158973691 -0400
@@ -919,6 +919,13 @@ get_luks_crypt_dev()
[[ -b /dev/block/$1 ]] || return 1
+ # blkid will fail if it is run on a LVM private. Make sure blkid succeeds before proceeding.
+ blkid -u filesystem,crypto -o export -- /dev/block/$1 > /dev/null
+ if [ $? -ne 0 ]
+ then
+ return 1
+ fi
+
_type=$(blkid -u filesystem,crypto -o export -- "/dev/block/$1" | \
sed -n -E "s/^TYPE=(.*)$/\1/p")
[[ $_type == "crypto_LUKS" ]] && echo "$1"
--
2.31.1