]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
udev rules improvement
authorNeilBrown <neilb@suse.de>
Thu, 18 Aug 2011 05:17:52 +0000 (15:17 +1000)
committerNeilBrown <neilb@suse.de>
Thu, 18 Aug 2011 05:17:52 +0000 (15:17 +1000)
Don't try to pass and empty path to "mdadm -If" - it will cause
problems.

Signed-off-by: NeilBrown <neilb@suse.de>
udev-md-raid.rules

index 1d898332e4dee19c8467a077b133b88914c0beb3..c2105bc18bba40794a69d639453a54887b5e56b7 100644 (file)
@@ -3,9 +3,11 @@
 SUBSYSTEM!="block", GOTO="md_end"
 
 # handle potential components of arrays
-ENV{ID_FS_TYPE}=="linux_raid_member", ACTION=="remove", RUN+="/sbin/mdadm -If $name --path $env{ID_PATH}"
+ENV{ID_FS_TYPE}=="linux_raid_member", ENV{ID_PATH}!="", ACTION=="remove", RUN+="/sbin/mdadm -If $name --path $env{ID_PATH}"
+ENV{ID_FS_TYPE}=="linux_raid_member", ENV{ID_PATH}=="", ACTION=="remove", RUN+="/sbin/mdadm -If $name"
 ENV{ID_FS_TYPE}=="linux_raid_member", ACTION=="add", RUN+="/sbin/mdadm --incremental $env{DEVNAME}"
-ENV{ID_FS_TYPE}=="isw_raid_member", ACTION=="remove", RUN+="/sbin/mdadm -If $name --path $env{ID_PATH}"
+ENV{ID_FS_TYPE}=="isw_raid_member", ENV{ID_PATH}!="", ACTION=="remove", RUN+="/sbin/mdadm -If $name --path $env{ID_PATH}"
+ENV{ID_FS_TYPE}=="isw_raid_member", ENV{ID_PATH}=="", ACTION=="remove", RUN+="/sbin/mdadm -If $name"
 ENV{ID_FS_TYPE}=="isw_raid_member", ACTION=="add", RUN+="/sbin/mdadm --incremental $env{DEVNAME}"
 
 # handle md arrays