summaryrefslogtreecommitdiff
path: root/udev
diff options
context:
space:
mode:
authorPeter Rajnoha <prajnoha@redhat.com>2013-05-03 11:01:57 +0200
committerPeter Rajnoha <prajnoha@redhat.com>2013-05-03 11:01:57 +0200
commitbaf9ef2047675279c72f27abeb2c328f5de2c78d (patch)
treeeb81c85e54e0f1f513c6a4f48e015a391b39ff3a /udev
parentf39f5b86c3f94fe83744054012d6d8b33bb7d7a0 (diff)
downloadlvm2-baf9ef2047675279c72f27abeb2c328f5de2c78d.tar.gz
udev: add a few comments about variables used to recognize events
Diffstat (limited to 'udev')
-rw-r--r--udev/10-dm.rules.in18
1 files changed, 18 insertions, 0 deletions
diff --git a/udev/10-dm.rules.in b/udev/10-dm.rules.in
index 512d156dd..3a157d538 100644
--- a/udev/10-dm.rules.in
+++ b/udev/10-dm.rules.in
@@ -77,11 +77,29 @@ LABEL="dm_flags_done"
# 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.
+# The DM_ACTIVATION variable tells when any device stacked above should be
+# (re)activated as well.
ACTION!="add", GOTO="dm_no_coldplug"
ENV{DM_UDEV_RULES_VSN}!="1", ENV{DM_UDEV_PRIMARY_SOURCE_FLAG}!="1", GOTO="dm_disable"
ENV{DM_ACTIVATION}="1"
LABEL="dm_no_coldplug"
+# Putting it together, following table is used to recognize genuine and spurious events.
+# N.B. Spurious events are generated based on use of the WATCH udev
+# rule or by triggering an event manually by "udevadm trigger" call
+# or by "echo <event_name> > /sys/block/dm-X/uevent".
+#
+# EVENT DM_UDEV_PRIMARY_SOURCE_FLAG DM_ACTIVATION
+# ======================================================================
+# add event (genuine) 0 0
+# change event (genuine) 1 1
+# add event (spurious)
+# |_ dev still not active 0 0
+# \_ dev already active 1 1
+# change event (spurious)
+# |_ dev still not active 0 0
+# \_ dev already active 1 0
+
# "dm" sysfs subdirectory is available in newer versions of DM
# only (kernels >= 2.6.29). We have to check for its existence
# and use dmsetup tool instead to get the DM name, uuid and