diff options
author | NeilBrown <neilb@suse.de> | 2019-09-18 07:12:55 +0200 |
---|---|---|
committer | Jes Sorensen <jsorensen@fb.com> | 2019-10-01 16:08:55 +0200 |
commit | 7bd59e7926c6921121087eb067befaa896c900a4 (patch) | |
tree | 6d616c5ed97de40b6bb373dad291bba6530d6e7e /udev-md-raid-arrays.rules | |
parent | Don't need to check recovery after re-add when no I/O writes to raid (diff) | |
download | mdadm-7bd59e7926c6921121087eb067befaa896c900a4.tar.xz mdadm-7bd59e7926c6921121087eb067befaa896c900a4.zip |
udev: allow for udev attribute reading bug.
There is a bug in udev (which will hopefully get fixed, but
we should allow for it anways).
When reading a sysfs attribute, it first reads the whole
value of the attribute, then reads again expecting to get
a read of 0 bytes, like you would with an ordinary file.
If the sysfs attribute changed between these two reads, it can
get a mixture of two values.
In particular, if it reads when 'array_state' is changing from
'clear' to 'inactive', it can find the value as "clear\nve".
This causes the test for "|clear|active" to fail, so systemd is allowed
to think that the array is ready - when it isn't.
So change the pattern to allow for this but adding a wildcard at
the end.
Also don't allow for an empty string - reading array_state will
never return an empty string - if it exists at all, it will be
non-empty.
Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
Diffstat (limited to 'udev-md-raid-arrays.rules')
-rw-r--r-- | udev-md-raid-arrays.rules | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/udev-md-raid-arrays.rules b/udev-md-raid-arrays.rules index d3916651..c8fa8e89 100644 --- a/udev-md-raid-arrays.rules +++ b/udev-md-raid-arrays.rules @@ -14,7 +14,7 @@ ENV{DEVTYPE}=="partition", GOTO="md_ignore_state" # 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", ENV{SYSTEMD_READY}="0", GOTO="md_end" -ATTR{md/array_state}=="|clear|inactive", ENV{SYSTEMD_READY}="0", GOTO="md_end" +ATTR{md/array_state}=="clear*|inactive", ENV{SYSTEMD_READY}="0", GOTO="md_end" LABEL="md_ignore_state" IMPORT{program}="BINDIR/mdadm --detail --no-devices --export $devnode" |