Linux Hotplug development
 help / color / mirror / Atom feed
* [PATCH] 64-md-raid.rules fixes v2
@ 2009-03-15 21:21 Michal Soltys
  2009-03-16  0:51 ` Kay Sievers
  2009-04-14  1:33 ` Neil Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Michal Soltys @ 2009-03-15 21:21 UTC (permalink / raw)
  To: linux-hotplug

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@ziu.info>
---
 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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-04-14  1:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-15 21:21 [PATCH] 64-md-raid.rules fixes v2 Michal Soltys
2009-03-16  0:51 ` Kay Sievers
2009-04-14  1:33 ` Neil Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox