]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Monitor: handle v.quick removal of devices better.
authorNeilBrown <neilb@suse.de>
Tue, 22 Mar 2011 03:47:55 +0000 (14:47 +1100)
committerNeilBrown <neilb@suse.de>
Tue, 22 Mar 2011 03:47:55 +0000 (14:47 +1100)
If a device fails and then is removed before Monitor sees
the failure, GET_DISK_INFO returns nothing so Monitor relies
on mdstat info where '_' is incorrectly interpreted as 'a spare'.

We should treat '_' as 'removed' - that is safer.

Without this, a v.quick fail+remove gets reported as 'Failed' then
'SpareActive'.

Signed-off-by: NeilBrown <neilb@suse.de>
Monitor.c

index 3f211b5b4cd152916b2456e47d737f6e3d245024..c1795663861a789a22b89c77a8466be3aa587287 100644 (file)
--- a/Monitor.c
+++ b/Monitor.c
@@ -607,7 +607,7 @@ static int check_array(struct state *st, struct mdstat_ent *mdstat,
                } else if (mse &&  mse->pattern && i < (int)strlen(mse->pattern)) {
                        switch(mse->pattern[i]) {
                        case 'U': newstate = 6 /* ACTIVE/SYNC */; break;
-                       case '_': newstate = 0; break;
+                       case '_': newstate = 8 /* REMOVED */; break;
                        }
                        disc.major = disc.minor = 0;
                }