[lvm2/f20] Additional fix for SYSTEMD_READY env var assignment in lvmetad udev rules.

Peter Rajnoha prajnoha at fedoraproject.org
Wed Dec 11 12:43:56 UTC 2013


commit 26746f8b93ea4ddb966981195abd4d48a00eddfc
Author: Peter Rajnoha <prajnoha at redhat.com>
Date:   Wed Dec 11 13:42:54 2013 +0100

    Additional fix for SYSTEMD_READY env var assignment in lvmetad udev rules.

 ...ignment-for-foreign-devs-in-lvmetad-rules.patch |   58 ++++++++++++++++++++
 lvm2.spec                                          |    7 ++-
 2 files changed, 64 insertions(+), 1 deletions(-)
---
diff --git a/lvm2-2_02_105-udev-fix-systemd_ready-env-var-assignment-for-foreign-devs-in-lvmetad-rules.patch b/lvm2-2_02_105-udev-fix-systemd_ready-env-var-assignment-for-foreign-devs-in-lvmetad-rules.patch
new file mode 100644
index 0000000..d242ac9
--- /dev/null
+++ b/lvm2-2_02_105-udev-fix-systemd_ready-env-var-assignment-for-foreign-devs-in-lvmetad-rules.patch
@@ -0,0 +1,58 @@
+commit cc9adc9d85426e53f50f9d6a2a39e82cac545c61
+Author: Peter Rajnoha <prajnoha at redhat.com>
+Date:   Wed Dec 11 13:13:21 2013 +0100
+
+    udev: fix SYSTEMD_READY assignment for foreign devices in lvmetad rules
+    
+    Some devices, similarly to us, are not prepared after ADD event, but
+    after an extra CHANGE event when the device is properly set up.
+    This includes MD and loop devices. This patch fixes the
+    SYSTEMD_READY assignment that is crucial for proper functionality
+    of SYSTEMD_WANTS that we use to instantiate a lvm2-pvscan at .service
+    systemd service to activate the VG/LVs (see also bug
+    info).
+    
+    All that extra handling of foreign devices should eventually be moved
+    to rules which process those devices primarily (MD and loop)! We should
+    only check a dedicated variable whether the device is usable or not.
+---
+ udev/69-dm-lvm-metad.rules.in | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/udev/69-dm-lvm-metad.rules.in b/udev/69-dm-lvm-metad.rules.in
+index 5b15b6f..d0b7b2a 100644
+--- a/udev/69-dm-lvm-metad.rules.in
++++ b/udev/69-dm-lvm-metad.rules.in
+@@ -39,6 +39,8 @@ ACTION=="remove", GOTO="lvm_scan"
+ # but they require an extra setup and they are ready after a CHANGE event.
+ # Also support coldplugging with ADD event but only if the device is already
+ # properly activated.
++# This logic should be eventually moved to rules where those particular
++# devices are processed primarily (MD and loop).
+ 
+ # DM device:
+ KERNEL!="dm-[0-9]*", GOTO="next"
+@@ -52,6 +54,7 @@ IMPORT{db}="LVM_MD_PV_ACTIVATED"
+ ACTION=="add", ENV{LVM_MD_PV_ACTIVATED}=="1", GOTO="lvm_scan"
+ ACTION=="change", ENV{LVM_MD_PV_ACTIVATED}!="1", TEST=="md/array_state", ENV{LVM_MD_PV_ACTIVATED}="1", GOTO="lvm_scan"
+ ACTION=="add", KERNEL=="md[0-9]*p[0-9]*", GOTO="lvm_scan"
++ENV{SYSTEMD_READY}="0"
+ GOTO="lvm_end"
+ 
+ # Loop device:
+@@ -59,6 +62,7 @@ LABEL="next"
+ KERNEL!="loop[0-9]*", GOTO="next"
+ ACTION=="add", ENV{LVM_LOOP_PV_ACTIVATED}=="1", GOTO="lvm_scan"
+ ACTION=="change", ENV{LVM_LOOP_PV_ACTIVATED}!="1", TEST=="loop/backing_file", ENV{LVM_LOOP_PV_ACTIVATED}="1", GOTO="lvm_scan"
++ENV{SYSTEMD_READY}="0"
+ GOTO="lvm_end"
+ 
+ # If the PV is not a special device listed above, scan only after device addition (ADD event)
+@@ -80,6 +84,7 @@ LABEL="lvm_scan"
+ #  MD    |          |      X      |       X*       |                   |
+ #  loop  |          |      X      |       X*       |                   |
+ #  other |    X     |             |       X        |                   |   X
++ENV{SYSTEMD_READY}="1"
+ (PVSCAN_RULE)
+ 
+ LABEL="lvm_end"
diff --git a/lvm2.spec b/lvm2.spec
index 8a199b4..258dbb0 100644
--- a/lvm2.spec
+++ b/lvm2.spec
@@ -37,7 +37,7 @@
 Summary: Userland logical volume management tools 
 Name: lvm2
 Version: 2.02.103
-Release: 3%{?dist}
+Release: 4%{?dist}
 License: GPLv2
 Group: System Environment/Base
 URL: http://sources.redhat.com/lvm2
@@ -46,6 +46,7 @@ Patch0: lvm2-set-default-preferred_names.patch
 Patch1: lvm2-enable-lvmetad-by-default.patch
 Patch2: lvm2-2_02_104-additional-fixes-from-v104.patch
 Patch3: lvm2-2_02_104-additional-udev-fixes-from-v104.patch
+Patch4: lvm2-2_02_105-udev-fix-systemd_ready-env-var-assignment-for-foreign-devs-in-lvmetad-rules.patch
 
 BuildRequires: libselinux-devel >= %{libselinux_version}, libsepol-devel
 BuildRequires: ncurses-devel
@@ -84,6 +85,7 @@ or more physical volumes and creating one or more logical volumes
 %patch1 -p1 -b .enable_lvmetad
 %patch2 -p1 -b .v104
 %patch3 -p1 -b .v104_udev
+%patch4 -p1 -b .systemd_ready
 
 %build
 %define _default_pid_dir /run
@@ -581,6 +583,9 @@ the device-mapper event library.
 %{_libdir}/pkgconfig/devmapper-event.pc
 
 %changelog
+* Wed Dec 11 2013 Peter Rajnoha <prajnoha at redhat.com> - 2.02.103-4
+- Fix SYSTEMD_READY assignment for foreign devs in lvmetad rules.
+
 * Wed Oct 30 2013 Peter Rajnoha <prajnoha at redhat.com> - 2.02.103-3
 - Fix missing lvmetad scan for PVs found on MD partitions.
 - Respect DM_UDEV_DISABLE_OTHER_RULES_FLAG in lvmetad udev rules.


More information about the scm-commits mailing list