summaryrefslogtreecommitdiffstats
path: root/monitor.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2008-08-19 14:54:55 +1000
committerNeilBrown <neilb@suse.de>2008-08-19 14:54:55 +1000
commit01f157d74ab29d3acf46800ffdaac3a0d0345b51 (patch)
tree57520e26c75ab39ba8689ee476fbd5ed65690161 /monitor.c
parent9296754385aa1fecb45097ba06fc82cbc0e5f14a (diff)
downloadmdadm-01f157d74ab29d3acf46800ffdaac3a0d0345b51.tar.gz
mdadm-01f157d74ab29d3acf46800ffdaac3a0d0345b51.tar.xz
mdadm-01f157d74ab29d3acf46800ffdaac3a0d0345b51.zip
Extra option for set_array_state: you choose dirty or clean.
When we first start an array, it might be good to start recovery straight away. That requires setting the array to 'dirty', but only the metadata handler can know if that is required or not. So have a third possible 'consistent' option to set_array_state. Either 'no' or 'yes' or 'you choose'. Return value indicates what was chosen. '1' (no) should be chosen unless there is a good reason. Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'monitor.c')
-rw-r--r--monitor.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/monitor.c b/monitor.c
index ffb4c9c..900cba3 100644
--- a/monitor.c
+++ b/monitor.c
@@ -243,18 +243,10 @@ static int read_and_act(struct active_array *a)
* readonly ???
*/
get_resync_start(a);
- if (a->resync_start == ~0ULL) {
+ if (a->container->ss->set_array_state(a, 2))
a->next_state = read_auto; /* array is clean */
- /* give the metadata a chance to force active if
- * we have some recovery to do. metadata sets
- * resync_start to !MaxSector in this case
- */
- a->container->ss->set_array_state(a, 1);
- }
- if (a->resync_start != ~0ULL) {
- a->container->ss->set_array_state(a, 0);
- a->next_state = active;
- }
+ else
+ a->next_state = active; /* Now active for recovery etc */
}
if (!deactivate &&