summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Bächler <thomas@archlinux.org>2013-02-09 21:49:47 +0100
committerNeilBrown <neilb@suse.de>2013-02-11 11:15:34 +1100
commit2452f13a41d3e6fb00665a2d27fbfbf4f51a7464 (patch)
tree758cabb4ea3faa984ef7adca97f8b380b5411945
parent3ab6bf304a364488aabeecdf283bfee54f10d649 (diff)
udev: Fix order of execution of the md rules
Right now, the rules that run blkid on raid arrays are executed after the assembly rules. This means incremental assembly will always fail when raid arrays are again physical components of raid arrays. Instead of simply reversing the order, split the rules up into two files, one dealing with array properties and one dealing with assembly. Signed-off-by: NeilBrown <neilb@suse.de>
-rw-r--r--Makefile5
-rw-r--r--udev-md-raid-arrays.rules (renamed from udev-md-raid.rules)14
-rw-r--r--udev-md-raid-assembly.rules19
3 files changed, 22 insertions, 16 deletions
diff --git a/Makefile b/Makefile
index b6edb23d..ad0819d3 100644
--- a/Makefile
+++ b/Makefile
@@ -262,8 +262,9 @@ install-man: mdadm.8 md.4 mdadm.conf.5 mdmon.8
$(INSTALL) -D -m 644 md.4 $(DESTDIR)$(MAN4DIR)/md.4
$(INSTALL) -D -m 644 mdadm.conf.5 $(DESTDIR)$(MAN5DIR)/mdadm.conf.5
-install-udev: udev-md-raid.rules
- $(INSTALL) -D -m 644 udev-md-raid.rules $(DESTDIR)$(UDEVDIR)/rules.d/64-md-raid.rules
+install-udev: udev-md-raid-arrays.rules udev-md-raid-assembly.rules
+ $(INSTALL) -D -m 644 udev-md-raid-arrays.rules $(DESTDIR)$(UDEVDIR)/rules.d/63-md-raid-arrays.rules
+ $(INSTALL) -D -m 644 udev-md-raid-assembly.rules $(DESTDIR)$(UDEVDIR)/rules.d/64-md-raid-assembly.rules
install-systemd: systemd/mdmon@.service
$(INSTALL) -D -m 644 systemd/mdmon@.service $(DESTDIR)$(SYSTEMD_DIR)/mdmon@.service
diff --git a/udev-md-raid.rules b/udev-md-raid-arrays.rules
index ea97261b..0540ed80 100644
--- a/udev-md-raid.rules
+++ b/udev-md-raid-arrays.rules
@@ -2,20 +2,6 @@
SUBSYSTEM!="block", GOTO="md_end"
-# handle potential components of arrays (the ones supported by md)
-ENV{ID_FS_TYPE}=="ddf_raid_member|isw_raid_member|linux_raid_member", GOTO="md_inc"
-GOTO="md_inc_skip"
-
-LABEL="md_inc"
-
-# remember you can limit what gets auto/incrementally assembled by
-# mdadm.conf(5)'s 'AUTO' and selectively whitelist using 'ARRAY'
-ACTION=="add", RUN+="/sbin/mdadm --incremental $devnode --offroot"
-ACTION=="remove", ENV{ID_PATH}=="?*", RUN+="/sbin/mdadm -If $name --path $env{ID_PATH}"
-ACTION=="remove", ENV{ID_PATH}!="?*", RUN+="/sbin/mdadm -If $name"
-
-LABEL="md_inc_skip"
-
# handle md arrays
ACTION!="add|change", GOTO="md_end"
KERNEL!="md*", GOTO="md_end"
diff --git a/udev-md-raid-assembly.rules b/udev-md-raid-assembly.rules
new file mode 100644
index 00000000..b6532658
--- /dev/null
+++ b/udev-md-raid-assembly.rules
@@ -0,0 +1,19 @@
+# do not edit this file, it will be overwritten on update
+
+# assemble md arrays
+
+SUBSYSTEM!="block", GOTO="md_inc_end"
+
+# handle potential components of arrays (the ones supported by md)
+ENV{ID_FS_TYPE}=="ddf_raid_member|isw_raid_member|linux_raid_member", GOTO="md_inc"
+GOTO="md_inc_end"
+
+LABEL="md_inc"
+
+# remember you can limit what gets auto/incrementally assembled by
+# mdadm.conf(5)'s 'AUTO' and selectively whitelist using 'ARRAY'
+ACTION=="add", RUN+="/sbin/mdadm --incremental $devnode --offroot"
+ACTION=="remove", ENV{ID_PATH}=="?*", RUN+="/sbin/mdadm -If $name --path $env{ID_PATH}"
+ACTION=="remove", ENV{ID_PATH}!="?*", RUN+="/sbin/mdadm -If $name"
+
+LABEL="md_inc_end"