From 38376c2e51fdc31b7e53d285729fb80b756d8d37 Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Tue, 22 Mar 2011 14:47:55 +1100 Subject: [PATCH] Monitor: handle v.quick removal of devices better. 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 --- Monitor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Monitor.c b/Monitor.c index 3f211b5b..c1795663 100644 --- 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; } -- 2.39.2