summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKrzysztof Wojcik <krzysztof.wojcik@intel.com>2011-03-10 17:07:04 +1100
committerNeilBrown <neilb@suse.de>2011-03-10 17:07:04 +1100
commit3275e05ec139728e23afde2a04f1adc5a4be473b (patch)
tree58753a9e2a8847938b4d1e8b0e51c9972d725435
parentabe7250bc70d938f21ccdf0d7686feb39561fe7f (diff)
downloadmdadm-3275e05ec139728e23afde2a04f1adc5a4be473b.tar.gz
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>
-rw-r--r--monitor.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/monitor.c b/monitor.c
index 59b4181..65a7034 100644
--- a/monitor.c
+++ b/monitor.c
@@ -228,6 +228,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);