[lvm-devel] LVM2 ./WHATS_NEW_DM udev/10-dm.rules.in

prajnoha at sourceware.org prajnoha at sourceware.org
Thu Aug 12 13:41:20 UTC 2010


CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	prajnoha at sourceware.org	2010-08-12 13:41:19

Modified files:
	.              : WHATS_NEW_DM 
	udev           : 10-dm.rules.in 

Log message:
	Fix udev rules to support udev database content generated by older rules.
	
	This can happen with older rules (without support for synthesized events)
	that are still part of initrd while using new udev rules in the system itself.
	
	The consequence was that new udev rules incorrectly assumed that not having
	DM_UDEV_PRIMARY_SOURCE_FLAG set always means the uevent is synthesized and
	inappropriate (device is still not properly activated) and so it should be
	ignored. However, initrd is not updated automatically while updating the
	libdevmapper/udev rules in the system and so we end up with the rules not
	detecting and setting crucial parts in the initrd environment and the rules
	in the system that rely on the information that should have been stored in
	udev db (which is incorrect in this configuration, of course).
	
	The overall consequence is that the update of libdevmapper/lvm2 without
	regenerating the initrd could end up with a boot failure! Ignoring the event
	means removing any existing symlinks in /dev!
	
	To fix this, increase udev rules version to make a difference. So from now on,
	mark rules without proper support for synthesized events as
	DM_UDEV_RULES_VSN="1" and 2 (or higher) if that support is included.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW_DM.diff?cvsroot=lvm2&r1=1.406&r2=1.407
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/udev/10-dm.rules.in.diff?cvsroot=lvm2&r1=1.11&r2=1.12

--- LVM2/WHATS_NEW_DM	2010/08/12 13:07:08	1.406
+++ LVM2/WHATS_NEW_DM	2010/08/12 13:41:18	1.407
@@ -1,5 +1,6 @@
 Version 1.02.54 - 
 ================================
+  Fix udev rules to support udev database content generated by older rules.
   Reinstate detection of inappropriate uevent with DISK_RO set and suppress it.
   Fix segfault in regex matcher with characters of ordinal value > 127.
   Use built-in rule for device aliases: block/ < dm- < disk/ < mapper/ < other.
--- LVM2/udev/10-dm.rules.in	2010/08/12 13:07:08	1.11
+++ LVM2/udev/10-dm.rules.in	2010/08/12 13:41:19	1.12
@@ -66,6 +66,7 @@
 IMPORT{db}="DM_SUBSYSTEM_UDEV_FLAG5"
 IMPORT{db}="DM_SUBSYSTEM_UDEV_FLAG6"
 IMPORT{db}="DM_SUBSYSTEM_UDEV_FLAG7"
+IMPORT{db}="DM_UDEV_RULES_VSN"
 LABEL="dm_flags_done"
 
 # Normally, we operate on "change" events. But when coldplugging, there's an
@@ -80,7 +81,7 @@
 # before (e.g. in initrd). If udev is used in initrd, we require the udev init
 # script to not remove the existing udev database so we can reuse the information
 # stored at the time of device activation in the initrd.
-ACTION=="add", ENV{DM_UDEV_PRIMARY_SOURCE_FLAG}!="1", GOTO="dm_disable"
+ACTION=="add", ENV{DM_UDEV_RULES_VSN}!="1", ENV{DM_UDEV_PRIMARY_SOURCE_FLAG}!="1", GOTO="dm_disable"
 
 # "dm" sysfs subdirectory is available in newer versions of DM
 # only (kernels >= 2.6.29). We have to check for its existence
@@ -106,7 +107,9 @@
 # fact (e.g. fallback to rules that behave correctly even without
 # these rules installed). It also provides versioning for any
 # possible future changes.
-ENV{DM_UDEV_RULES_VSN}="1"
+# VSN 1 - original rules
+# VSN 2 - add support for synthesized events
+ENV{DM_UDEV_RULES_VSN}="2"
 
 ENV{DM_UDEV_DISABLE_DM_RULES_FLAG}!="1", ENV{DM_NAME}=="?*", SYMLINK+="(DM_DIR)/$env{DM_NAME}"
 




More information about the lvm-devel mailing list