summaryrefslogtreecommitdiffstats
path: root/monitor.c
diff options
context:
space:
mode:
authorKrzysztof Wojcik <krzysztof.wojcik@intel.com>2011-01-25 07:44:11 +0100
committerNeilBrown <neilb@suse.de>2011-01-26 01:47:52 +0100
commit10ce18083dd0847764494eec1d1bf652c453d740 (patch)
treef261b3d60df34aeb02a66288684d40f44269576a /monitor.c
parentCheck number of failed disks durig raid10->raid0 takeover (diff)
downloadmdadm-10ce18083dd0847764494eec1d1bf652c453d740.tar.xz
mdadm-10ce18083dd0847764494eec1d1bf652c453d740.zip
FIX: Reset disk state if disk is missing
If we can't read actual disk state, it shoud be initiated to 0. Overwise it may be out of date value resulting false action later in code (e.g. set disk to improper state). Signed-off-by: Krzysztof Wojcik <krzysztof.wojcik@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'monitor.c')
-rw-r--r--monitor.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/monitor.c b/monitor.c
index b7287d8b..8d33a5dd 100644
--- a/monitor.c
+++ b/monitor.c
@@ -229,6 +229,7 @@ static int read_and_act(struct active_array *a)
sync_completed = read_sync_completed(a->sync_completed_fd);
for (mdi = a->info.devs; mdi ; mdi = mdi->next) {
mdi->next_state = 0;
+ mdi->curr_state = 0;
if (mdi->state_fd >= 0) {
mdi->recovery_start = read_resync_start(mdi->recovery_fd);
mdi->curr_state = read_dev_state(mdi->state_fd);