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