From: Thomas Bächler Date: Sat, 9 Feb 2013 20:49:47 +0000 (+0100) Subject: udev: Fix order of execution of the md rules X-Git-Tag: mdadm-3.3-rc1~120 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2452f13a41d3e6fb00665a2d27fbfbf4f51a7464;p=thirdparty%2Fmdadm.git 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 --- 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 similarity index 75% rename from udev-md-raid.rules rename to 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"