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

* Re: [PATCH] 64-md-raid.rules fixes v2
  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
  1 sibling, 0 replies; 3+ messages in thread
From: Kay Sievers @ 2009-03-16  0:51 UTC (permalink / raw)
  To: linux-hotplug

On Sun, Mar 15, 2009 at 22:21, Michal Soltys <soltys@ziu.info> wrote:
> 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

I've committed this. Neil, please update your rules file too.

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

I left this out, the rules file in the udev tree is just a copy from
the mdadm source tree. It's a new feature of mdadm3, and if Neil wants
that for the old mdadm, he should add it to the old mdadm binary
itself and also ship the rules there. Udev should not mess around in
other packages features. :)

Thanks,
Kay

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

* Re: [PATCH] 64-md-raid.rules fixes v2
  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
  1 sibling, 0 replies; 3+ messages in thread
From: Neil Brown @ 2009-04-14  1:33 UTC (permalink / raw)
  To: linux-hotplug

On Sunday March 15, soltys@ziu.info wrote:
(sorry for taking nearly a month to reply...)

> 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

Thanks.  I've applies this (with a slightly more verbose comment) in
the version of the rules file to be released with mdadm-3.0

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

I probably don't agree with this.
mdadm 2.x created dev files in /dev directly.  So it does not expect
udev to do anything, particularly with names.

mdadm 3.x by contrast doesn't create anything in /dev (if udev seems
to be installed) so the rules file must create everything.

So I think that 'compat' rule is wrong.  I'm happy to listen to more
details arguments though.

http://neil.brown.name/git?p=mdadm;a=commitdiff;hú5090285af9401f950aa5c1a3a82708c69c4906

Thanks,
NeilBrown

^ permalink raw reply	[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