Linux Hotplug development
 help / color / mirror / Atom feed
From: Michal Soltys <soltys@ziu.info>
To: linux-hotplug@vger.kernel.org
Subject: [PATCH] 64-md-raid.rules fixes v2
Date: Sun, 15 Mar 2009 21:21:56 +0000	[thread overview]
Message-ID: <7fe3a91a4b0971f1be490bdaccf37479047ac0a0.1237151296.git.soltys@ziu.info> (raw)

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


             reply	other threads:[~2009-03-15 21:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-15 21:21 Michal Soltys [this message]
2009-03-16  0:51 ` [PATCH] 64-md-raid.rules fixes v2 Kay Sievers
2009-04-14  1:33 ` Neil Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7fe3a91a4b0971f1be490bdaccf37479047ac0a0.1237151296.git.soltys@ziu.info \
    --to=soltys@ziu.info \
    --cc=linux-hotplug@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox