059e59
From f659bd462a6b605c36a89fa205b41bf8f55c41be Mon Sep 17 00:00:00 2001
059e59
From: David Teigland <teigland@redhat.com>
059e59
Date: Fri, 17 Dec 2021 12:14:51 -0600
059e59
Subject: [PATCH] fix(lvm): restore setting LVM_MD_PV_ACTIVATED
059e59
059e59
The 69-dm-lvm-metad.rules udev rule has been removed from
059e59
the initrd, because it's been dropped by recent upstream
059e59
lvm versions, and it never performed any primary function
059e59
within the initrd.  But, it did have the job of setting
059e59
LVM_MD_PV_ACTIVATED=1 for active md devices used by PVs.
059e59
That step needs to be restored, and is now included in
059e59
64-lvm.rules.
059e59
059e59
(cherry picked from commit 164e5ebb1199ea3e3d641ce402d8257f0055a529)
059e59
059e59
Resolves: #2037955
059e59
---
059e59
 modules.d/90lvm/64-lvm.rules | 8 ++++++++
059e59
 1 file changed, 8 insertions(+)
059e59
059e59
diff --git a/modules.d/90lvm/64-lvm.rules b/modules.d/90lvm/64-lvm.rules
059e59
index ca718ce0..1ad49111 100644
059e59
--- a/modules.d/90lvm/64-lvm.rules
059e59
+++ b/modules.d/90lvm/64-lvm.rules
059e59
@@ -6,6 +6,14 @@
059e59
 
059e59
 SUBSYSTEM!="block", GOTO="lvm_end"
059e59
 ACTION!="add|change", GOTO="lvm_end"
059e59
+
059e59
+# If the md device is active (indicated by array_state), then set the flag
059e59
+# LVM_MD_PV_ACTIVATED=1 indicating that the md device for the PV is ready
059e59
+# to be used.  The lvm udev rule running in root will check that this flag
059e59
+# is set before it will process the md device (it wants to avoid
059e59
+# processing an md device that exists but is not yet ready to be used.)
059e59
+KERNEL=="md[0-9]*", ACTION=="change", ENV{ID_FS_TYPE}=="LVM2_member", ENV{LVM_MD_PV_ACTIVATED}!="1", TEST=="md/array_state", ENV{LVM_MD_PV_ACTIVATED}="1"
059e59
+
059e59
 # Also don't process disks that are slated to be a multipath device
059e59
 ENV{DM_MULTIPATH_DEVICE_PATH}=="1", GOTO="lvm_end"
059e59
 KERNEL=="dm-[0-9]*", ACTION=="add", GOTO="lvm_end"