]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Monitor: don't report the disappearance of a faulty device as SpareActive.
authorNeilBrown <neilb@suse.de>
Tue, 18 May 2010 02:31:29 +0000 (12:31 +1000)
committerNeilBrown <neilb@suse.de>
Tue, 18 May 2010 02:31:29 +0000 (12:31 +1000)
Normally Monitor doesn't see faulty devices in active slots - they get
moved away too quickly.
But if it does, it reports the "faulty device disappeared" event (when
it finally does get moved away) as SpareActive due to insufficient
checking.

So add a better check.

Reported-by: Pierre Vignéras <pierre@vigneras.name>
Monitor.c

index b0802f868043474a14e807f8005de3ca04d387aa..8e82797bba431a0165d1d787bd66fa264e243b95 100644 (file)
--- a/Monitor.c
+++ b/Monitor.c
@@ -391,6 +391,7 @@ int Monitor(mddev_dev_t devlist,
                                                )
                                                alert("FailSpare", dev, dv, mailaddr, mailfrom, alert_cmd, dosyslog);
                                        else if (i < (unsigned)array.raid_disks &&
+                                                ! (newstate & (1<<MD_DISK_REMOVED)) &&
                                                 (((st->devstate[i]&change)&(1<<MD_DISK_FAULTY)) ||
                                                  ((newstate&change)&(1<<MD_DISK_ACTIVE)) ||
                                                  ((newstate&change)&(1<<MD_DISK_SYNC)))