[PATCH] 64-md-raid.rules fixes v2

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



1) introduced in commit b822542608326092e177fd1707ca7fb53b2846c4

md/array_state in case of partition doesn't exists, so all uevents
for partitions didn't execute any SYMLINK rules

2) add compat rule, so both MD_DEVNAME (mdadm 3.0) and MD_NAME
   (mdadm 2.9.x) can be used

Signed-off-by: Michal Soltys <soltys@xxxxxxxx>
---
 rules/packages/64-md-raid.rules |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/rules/packages/64-md-raid.rules b/rules/packages/64-md-raid.rules
index abb029c..6f6f361 100644
--- a/rules/packages/64-md-raid.rules
+++ b/rules/packages/64-md-raid.rules
@@ -8,14 +8,22 @@ ACTION!="add|change", GOTO="md_end"
 # import data from a raid set
 KERNEL!="md*", GOTO="md_end"
 
+# partitions have no md/{array_state,metadata_version}
+ENV{DEVTYPE}=="partition", GOTO="md_ignore_state"
+
 # container devices have a metadata version of e.g. 'external:ddf' and
 # never leave state 'inactive'
 ATTR{md/metadata_version}=="external:[A-Za-z]*", ATTR{md/array_state}=="inactive", GOTO="md_ignore_state"
 TEST!="md/array_state", GOTO="md_end"
 ATTR{md/array_state}=="|clear|inactive", GOTO="md_end"
+
 LABEL="md_ignore_state"
 
 IMPORT{program}="/sbin/mdadm --detail --export $tempnode"
+
+# compat rule for mdadm 2.9.x
+ENV{MD_DEVNAME}!="?*", ENV{MD_NAME}=="?*", ENV{MD_DEVNAME}="$env{MD_NAME}"
+
 ENV{DEVTYPE}=="disk", ENV{MD_NAME}=="?*", SYMLINK+="disk/by-id/md-name-$env{MD_NAME}", OPTIONS+="string_escape=replace"
 ENV{DEVTYPE}=="disk", ENV{MD_UUID}=="?*", SYMLINK+="disk/by-id/md-uuid-$env{MD_UUID}"
 ENV{DEVTYPE}=="disk", ENV{MD_DEVNAME}=="?*", SYMLINK+="md/$env{MD_DEVNAME}"
-- 
1.6.2

--
To unsubscribe from this list: send the line "unsubscribe linux-hotplug" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel]     [Linux DVB]     [Asterisk Internet PBX]     [DCCP]     [Netdev]     [X.org]     [Util Linux NG]     [Fedora Women]     [ALSA Devel]     [Linux USB]

  Powered by Linux