Blame SOURCES/mdadm-3.2.6-Monitor-Don-t-write-metadata-in-inactive-array-state.patch

fc6001
From 24a216bf408db4ec61ec6f735d1eb84a0618bfbb Mon Sep 17 00:00:00 2001
fc6001
From: "mwilck@arcor.de" <mwilck@arcor.de>
fc6001
Date: Mon, 8 Jul 2013 23:50:38 +0200
fc6001
Subject: [PATCH] Monitor: Don't write metadata in inactive array state
fc6001
fc6001
The kernel docs state that meta data is never written in states
fc6001
clear, inactive, suspended, readonly, and read_auto.
fc6001
Why should this be different for containers?
fc6001
fc6001
We need to write metadata when the array is disabled, though.
fc6001
Tested with the DDF (10*) and IMSM (9*) tests, works.
fc6001
fc6001
Signed-off-by: NeilBrown <neilb@suse.de>
fc6001
---
fc6001
 monitor.c | 3 ++-
fc6001
 1 file changed, 2 insertions(+), 1 deletion(-)
fc6001
fc6001
diff --git a/monitor.c b/monitor.c
fc6001
index 47432b2..67b40b1 100644
fc6001
--- a/monitor.c
fc6001
+++ b/monitor.c
fc6001
@@ -416,7 +416,8 @@ static int read_and_act(struct active_array *a)
fc6001
 	if (sync_completed > a->last_checkpoint)
fc6001
 		a->last_checkpoint = sync_completed;
fc6001
 
fc6001
-	a->container->ss->sync_metadata(a->container);
fc6001
+	if (deactivate || a->curr_state >= clean)
fc6001
+		a->container->ss->sync_metadata(a->container);
fc6001
 	dprintf("%s(%d): state:%s action:%s next(", __func__, a->info.container_member,
fc6001
 		array_states[a->curr_state], sync_actions[a->curr_action]);
fc6001
 
fc6001
-- 
fc6001
1.8.3.1
fc6001