summaryrefslogtreecommitdiffstats
path: root/udev/10-dm.rules.in
diff options
context:
space:
mode:
authorPeter Rajnoha <prajnoha@redhat.com>2009-12-07 12:03:47 +0000
committerPeter Rajnoha <prajnoha@redhat.com>2009-12-07 12:03:47 +0000
commit0d408f0c4327e88bb081f9dfda11186c228d81ca (patch)
tree0b09c8912e06fe59ab53618c27bb6cbed87b707c /udev/10-dm.rules.in
parent59baeb838c9a3f39bf5c49a1cf5da9e47708f2df (diff)
downloadlvm2-0d408f0c4327e88bb081f9dfda11186c228d81ca.tar.gz
lvm2-0d408f0c4327e88bb081f9dfda11186c228d81ca.tar.xz
lvm2-0d408f0c4327e88bb081f9dfda11186c228d81ca.zip
Disable udev rules on change event with DISK_RO=1.
There's a new change udev event generated since kernel 2.6.32 that notifies userspace about a change in read-only attribute for block devices (with DISK_RO=1 environment variable set). We need to detect this and disable the rule application so the meaning of this change event is not interchanged with the regular change event used while resuming/renaming DM devices. If there's anybody awaiting this notification in foreign rules, he can still check for this env var and do the appropriate actions separately.
Diffstat (limited to 'udev/10-dm.rules.in')
-rw-r--r--udev/10-dm.rules.in7
1 files changed, 7 insertions, 0 deletions
diff --git a/udev/10-dm.rules.in b/udev/10-dm.rules.in
index aba0bf44..7cffc0bf 100644
--- a/udev/10-dm.rules.in
+++ b/udev/10-dm.rules.in
@@ -19,6 +19,13 @@ KERNEL=="device-mapper", NAME="(DM_DIR)/control"
SUBSYSTEM!="block", GOTO="dm_end"
KERNEL!="dm-[0-9]*", GOTO="dm_end"
+# There is a new change event generated in block layer since kernel
+# version 2.6.32. It adds notification for changes in read-only
+# attribute. We don't want to misinterpret the regular meaning of change
+# events for DM devices and we don't want to apply the rules prematurely,
+# therefore we disable them in this situation.
+ENV{DISK_RO}=="1", GOTO="dm_disable"
+
# Set proper sbin path, /sbin has higher priority than /usr/sbin.
ENV{DM_SBIN_PATH}="/sbin"
TEST!="$env{DM_SBIN_PATH}/dmsetup", ENV{DM_SBIN_PATH}="/usr/sbin"