]> git.ipfire.org Git - thirdparty/mdadm.git/commit
udev: allow for udev attribute reading bug.
authorNeilBrown <neilb@suse.de>
Wed, 18 Sep 2019 05:12:55 +0000 (15:12 +1000)
committerJes Sorensen <jsorensen@fb.com>
Tue, 1 Oct 2019 14:08:55 +0000 (10:08 -0400)
commit7bd59e7926c6921121087eb067befaa896c900a4
tree6d616c5ed97de40b6bb373dad291bba6530d6e7e
parent611093148574164fcf4f24f8c076d09473f655d7
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>
udev-md-raid-arrays.rules