Blame SOURCES/0041-udev-allow-for-udev-attribute-reading-bug.patch

2910d5
From 7bd59e7926c6921121087eb067befaa896c900a4 Mon Sep 17 00:00:00 2001
2910d5
From: NeilBrown <neilb@suse.de>
2910d5
Date: Wed, 18 Sep 2019 15:12:55 +1000
2910d5
Subject: [RHEL7.8 PATCH V2 41/47] udev: allow for udev attribute reading bug.
2910d5
2910d5
There is a bug in udev (which will hopefully get fixed, but
2910d5
we should allow for it anways).
2910d5
When reading a sysfs attribute, it first reads the whole
2910d5
value of the attribute, then reads again expecting to get
2910d5
a read of 0 bytes, like you would with an ordinary file.
2910d5
If the sysfs attribute changed between these two reads, it can
2910d5
get a mixture of two values.
2910d5
2910d5
In particular, if it reads when 'array_state' is changing from
2910d5
'clear' to 'inactive', it can find the value as "clear\nve".
2910d5
2910d5
This causes the test for "|clear|active" to fail, so systemd is allowed
2910d5
to think that the array is ready - when it isn't.
2910d5
2910d5
So change the pattern to allow for this but adding a wildcard at
2910d5
the end.
2910d5
Also don't allow for an empty string - reading array_state will
2910d5
never return an empty string - if it exists at all, it will be
2910d5
non-empty.
2910d5
2910d5
Signed-off-by: NeilBrown <neilb@suse.de>
2910d5
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
2910d5
---
2910d5
 udev-md-raid-arrays.rules | 2 +-
2910d5
 1 file changed, 1 insertion(+), 1 deletion(-)
2910d5
2910d5
diff --git a/udev-md-raid-arrays.rules b/udev-md-raid-arrays.rules
2910d5
index d391665..c8fa8e8 100644
2910d5
--- a/udev-md-raid-arrays.rules
2910d5
+++ b/udev-md-raid-arrays.rules
2910d5
@@ -14,7 +14,7 @@ ENV{DEVTYPE}=="partition", GOTO="md_ignore_state"
2910d5
 # never leave state 'inactive'
2910d5
 ATTR{md/metadata_version}=="external:[A-Za-z]*", ATTR{md/array_state}=="inactive", GOTO="md_ignore_state"
2910d5
 TEST!="md/array_state", ENV{SYSTEMD_READY}="0", GOTO="md_end"
2910d5
-ATTR{md/array_state}=="|clear|inactive", ENV{SYSTEMD_READY}="0", GOTO="md_end"
2910d5
+ATTR{md/array_state}=="clear*|inactive", ENV{SYSTEMD_READY}="0", GOTO="md_end"
2910d5
 LABEL="md_ignore_state"
2910d5
 
2910d5
 IMPORT{program}="BINDIR/mdadm --detail --no-devices --export $devnode"
2910d5
-- 
2910d5
2.7.5
2910d5