diff options
author | NeilBrown <neilb@suse.de> | 2010-12-16 15:48:05 +1100 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2010-12-16 15:48:05 +1100 |
commit | aad6f216a1c667ddfbb9a4a4c379ff32f69f962f (patch) | |
tree | 62c078397ae841a5f71df8a585151ba22853af4f /monitor.c | |
parent | 1af97990a6c8930c97f7943f0dac4b775c688274 (diff) |
Handle checkpointing during reshape
We need to allow metadata to handle progress of reshape,
completion, and abort-before-start.
Include all those in ->set_array_state()
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'monitor.c')
-rw-r--r-- | monitor.c | 16 |
1 files changed, 13 insertions, 3 deletions
@@ -339,8 +339,8 @@ static int read_and_act(struct active_array *a) /* Check for recovery checkpoint notifications. We need to be a * minimum distance away from the last checkpoint to prevent - * over checkpointing. Note reshape checkpointing is not - * handled here. + * over checkpointing. Note reshape checkpointing is handled + * in the second branch. */ if (sync_completed > a->last_checkpoint && sync_completed - a->last_checkpoint > a->info.component_size >> 4 && @@ -350,7 +350,17 @@ static int read_and_act(struct active_array *a) */ a->last_checkpoint = sync_completed; a->container->ss->set_array_state(a, a->curr_state <= clean); - } else if (sync_completed > a->last_checkpoint) + } else if ((a->curr_action == idle && a->prev_action == reshape) || + (a->curr_action == reshape + && sync_completed > a->last_checkpoint) ) { + /* Reshape has progressed or completed so we need to + * update the array state - and possibly the array size + */ + a->last_checkpoint = sync_completed; + a->container->ss->set_array_state(a, a->curr_state <= clean); + } + + if (sync_completed > a->last_checkpoint) a->last_checkpoint = sync_completed; a->container->ss->sync_metadata(a->container); |