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 <neilb@suse.de>
This commit is contained in:
NeilBrown 2011-03-22 14:47:55 +11:00
parent 7c19b781d5
commit ce7a187b9a
1 changed files with 1 additions and 1 deletions

View File

@ -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;
}