From ce7a187b9a2c58783276c9da65088494f4f85124 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 0f0adb5..7e8fa85 100644 --- a/Monitor.c +++ b/Monitor.c @@ -369,7 +369,7 @@ int Monitor(mddev_dev_t devlist, } 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; }