summaryrefslogtreecommitdiffstats
path: root/udev
diff options
context:
space:
mode:
authorPeter Rajnoha <prajnoha@redhat.com>2011-01-28 11:41:51 +0000
committerPeter Rajnoha <prajnoha@redhat.com>2011-01-28 11:41:51 +0000
commit7fa7632dc7633c9280dfb6694872cc0503a1797b (patch)
tree6a60a7e3a43721486ad04092d72ddecb99f4657c /udev
parent7f8badfe5edd68990aa7ff9366dfeb0bc746d6fe (diff)
downloadlvm2-7fa7632dc7633c9280dfb6694872cc0503a1797b.tar.gz
lvm2-7fa7632dc7633c9280dfb6694872cc0503a1797b.tar.xz
lvm2-7fa7632dc7633c9280dfb6694872cc0503a1797b.zip
Set DM_UDEV_DISABLE_OTHER_RULES_FLAG for suspended DM devices in udev rules.
This is to avoid any scanning and processing of DM devices while they are in suspended state (e.g. a rename while the device is suspended - a CHANGE event is generated!). Otherwise, any scanning in the rules could end up with locking the calling process until the device is resumed and so we don't receive a notification about udev rules completion until then (and that effectively locks out the process awaiting the notification!). However, we still keep 'disk' and any 'subsystem' related udev rules running. We trust these and these should check themselves whether a device is suspended or not, not trying to run any scanning if it is.
Diffstat (limited to 'udev')
-rw-r--r--udev/10-dm.rules.in5
1 files changed, 5 insertions, 0 deletions
diff --git a/udev/10-dm.rules.in b/udev/10-dm.rules.in
index 4d50ed3d..606a13db 100644
--- a/udev/10-dm.rules.in
+++ b/udev/10-dm.rules.in
@@ -119,6 +119,11 @@ ENV{DM_UUID}=="mpath-?*", ENV{DM_ACTION}=="PATH_FAILED", GOTO="dm_disable"
ENV{DM_UUID}=="CRYPT-TEMP-?*", GOTO="dm_disable"
ENV{DM_UUID}!="?*", ENV{DM_NAME}=="temporary-cryptsetup-?*", GOTO="dm_disable"
+# Avoid processing and scanning a DM device in the other (foreign)
+# rules if it is in suspended state. However, we still keep 'disk'
+# and 'DM subsystem' related rules enabled in this case.
+ENV{DM_SUSPENDED}=="1", ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}="1"
+
GOTO="dm_end"
LABEL="dm_disable"