]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
monitor: treat unreadable array_state as clean
authormwilck@arcor.de <mwilck@arcor.de>
Fri, 25 Oct 2013 10:07:38 +0000 (12:07 +0200)
committerNeilBrown <neilb@suse.de>
Tue, 23 Apr 2013 04:55:32 +0000 (14:55 +1000)
Failure to read array_state can only mean the array has been
deleted by the kernel; it is not an indication that the array
is dirty.

Signed-off-by: Martin Wilck <mwilck@arcor.de>
Signed-off-by: NeilBrown <neilb@suse.de>
monitor.c

index 60c5d5a286eb1b3a5210def0f0532edc7c2c4bff..47432b25f8a2774f5a80760e0a9c6e46fae5c5ee 100644 (file)
--- a/monitor.c
+++ b/monitor.c
@@ -265,7 +265,7 @@ static int read_and_act(struct active_array *a)
                 */
                a->container->ss->set_array_state(a, 0);
        }
-       if (a->curr_state <= inactive &&
+       if ((a->curr_state == bad_word || a->curr_state <= inactive) &&
            a->prev_state > inactive) {
                /* array has been stopped */
                a->container->ss->set_array_state(a, 1);
@@ -288,8 +288,7 @@ static int read_and_act(struct active_array *a)
                a->container->ss->set_array_state(a, 1);
        }
        if (a->curr_state == active ||
-           a->curr_state == suspended ||
-           a->curr_state == bad_word)
+           a->curr_state == suspended)
                ret |= ARRAY_DIRTY;
        if (a->curr_state == readonly) {
                /* Well, I'm ready to handle things.  If readonly