diff options
author | Mateusz Kusiak <mateusz.kusiak@intel.com> | 2024-01-18 11:30:17 +0100 |
---|---|---|
committer | Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com> | 2024-02-20 14:05:03 +0100 |
commit | fdb7e802f4cf64d067c3abaafa35056e2bc1ed43 (patch) | |
tree | f8ed1993ebe262f443dae0d56d9ee1f93f3bcb47 /super-intel.c | |
parent | monitor: refactor checkpoint update (diff) | |
download | mdadm-fdb7e802f4cf64d067c3abaafa35056e2bc1ed43.tar.xz mdadm-fdb7e802f4cf64d067c3abaafa35056e2bc1ed43.zip |
Super-intel: Fix first checkpoint restart
When imsm based array is stopped after reaching first checkpoint and
then assembled, first checkpoint is reported as 0.
This behaviour is valid only for initial checkpoint, if the array was
stopped while performing some action.
Last checkpoint value is not taken from metadata but always starts
with 0 and it's incremented when sync_completed in sysfs changes.
In simplification, read_and_act() is responsible for checkpoint updates
and is executed each time sysfs checkpoint update happens. For first
checkpoint it is executed twice and due to marking checkpoint before
triggering any action on the array, it is impossible to read
sync_completed from sysfs in just two iterations.
The workaround to this is not marking any checkpoint for first
sysfs checkpoint after RAID assembly, to preserve checkpoint value
stored in metadata.
Signed-off-by: Mateusz Kusiak <mateusz.kusiak@intel.com>
Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
Diffstat (limited to 'super-intel.c')
-rw-r--r-- | super-intel.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/super-intel.c b/super-intel.c index dbea235d..e61f3f6f 100644 --- a/super-intel.c +++ b/super-intel.c @@ -8771,6 +8771,9 @@ static int imsm_set_array_state(struct active_array *a, int consistent) super->updates_pending++; } + if (a->prev_action == idle) + goto skip_mark_checkpoint; + mark_checkpoint: /* skip checkpointing for general migration, * it is controlled in mdadm |