summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHarald Hoyer <harald@redhat.com>2012-08-13 08:00:21 +1000
committerNeilBrown <neilb@suse.de>2012-09-27 16:49:54 +1000
commit090900c3d2eb5b3aef5251a21228483c32246cc7 (patch)
treef1787bdb5224ccdbfcc85831c6ec4a41e311f88b
parent517f135d32cfe44a9ac8b0686dbb7be1bcabc867 (diff)
downloadmdadm-090900c3d2eb5b3aef5251a21228483c32246cc7.tar.gz
udev-rules: prevent systemd from mount devices before they are ready.
In the "add" uevent, ATTR{md/array_state} does not exist, so the next rule does not kick in. When an array is assembled incrementally, systemd might see it before it is ready, try to mount it, fail, and give up. Result is that array doesn't get mounted. If we ask udev to tell systemd that it isn't ready yet in this case, systemd waits until it is ready, and all are happy. Signed-off-by: NeilBrown <neilb@suse.de>
-rw-r--r--udev-md-raid.rules2
1 files changed, 1 insertions, 1 deletions
diff --git a/udev-md-raid.rules b/udev-md-raid.rules
index 814c897..da9d3c5 100644
--- a/udev-md-raid.rules
+++ b/udev-md-raid.rules
@@ -27,7 +27,7 @@ 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"
+TEST!="md/array_state", ENV{SYSTEMD_READY}="0", GOTO="md_end"
ATTR{md/array_state}=="|clear|inactive", ENV{SYSTEMD_READY}="0", GOTO="md_end"
LABEL="md_ignore_state"