]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Monitor: Don't write metadata in inactive array state
authormwilck@arcor.de <mwilck@arcor.de>
Mon, 8 Jul 2013 21:50:38 +0000 (23:50 +0200)
committerNeilBrown <neilb@suse.de>
Tue, 9 Jul 2013 04:42:38 +0000 (14:42 +1000)
The kernel docs state that meta data is never written in states
clear, inactive, suspended, readonly, and read_auto.
Why should this be different for containers?

We need to write metadata when the array is disabled, though.
Tested with the DDF (10*) and IMSM (9*) tests, works.

Signed-off-by: NeilBrown <neilb@suse.de>
monitor.c

index 47432b25f8a2774f5a80760e0a9c6e46fae5c5ee..67b40b19362cc9c3aa50e957c708649df8b8492c 100644 (file)
--- a/monitor.c
+++ b/monitor.c
@@ -416,7 +416,8 @@ static int read_and_act(struct active_array *a)
        if (sync_completed > a->last_checkpoint)
                a->last_checkpoint = sync_completed;
 
-       a->container->ss->sync_metadata(a->container);
+       if (deactivate || a->curr_state >= clean)
+               a->container->ss->sync_metadata(a->container);
        dprintf("%s(%d): state:%s action:%s next(", __func__, a->info.container_member,
                array_states[a->curr_state], sync_actions[a->curr_action]);