diff options
author | Michal Soltys <soltys@ziu.info> | 2011-09-08 09:25:08 +0200 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2011-09-19 05:07:44 +0200 |
commit | e5e54ff1d974079f2e0e05f7e0dc2f94b6d6b572 (patch) | |
tree | 978ea77a7f27a53cad70863abbdfe4749b5dacb7 | |
parent | Fix readding of a readwrite drive into a writemostly array (diff) | |
download | mdadm-e5e54ff1d974079f2e0e05f7e0dc2f94b6d6b572.tar.xz mdadm-e5e54ff1d974079f2e0e05f7e0dc2f94b6d6b572.zip |
udev rules: use $tempnode, check for supported types, comments
Few things adjusted in addition to
0f82fe603a42f37f1e2a6f826b4164811bf2d188:
- keep strict tests for supported types
- when accessing the device, use $tempnode
- few more comments
Signed-off-by: Michal Soltys <soltys@ziu.info>
Signed-off-by: NeilBrown <neilb@suse.de>
-rw-r--r-- | udev-md-raid.rules | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/udev-md-raid.rules b/udev-md-raid.rules index e251ac59..f564f70a 100644 --- a/udev-md-raid.rules +++ b/udev-md-raid.rules @@ -2,10 +2,19 @@ SUBSYSTEM!="block", GOTO="md_end" -# handle potential components of arrays -ENV{ID_FS_TYPE}=="*_raid_member", ENV{ID_PATH}!="", ACTION=="remove", RUN+="/sbin/mdadm -If $name --path $env{ID_PATH}" -ENV{ID_FS_TYPE}=="*_raid_member", ENV{ID_PATH}=="", ACTION=="remove", RUN+="/sbin/mdadm -If $name" -ENV{ID_FS_TYPE}=="*_raid_member", ACTION=="add", RUN+="/sbin/mdadm --incremental $env{DEVNAME}" +# 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 $tempnode" +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" |