From 01f157d74ab29d3acf46800ffdaac3a0d0345b51 Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Tue, 19 Aug 2008 14:54:55 +1000 Subject: 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 --- monitor.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'monitor.c') 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 && -- cgit