From: NeilBrown Date: Tue, 22 Mar 2011 03:47:55 +0000 (+1100) Subject: Monitor: handle v.quick removal of devices better. X-Git-Tag: mdadm-3.1.5~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ce7a187b9a2c58783276c9da65088494f4f85124;p=thirdparty%2Fmdadm.git 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 --- diff --git a/Monitor.c b/Monitor.c index 0f0adb54..7e8fa857 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; }