]> git.ipfire.org Git - thirdparty/mdadm.git/commit
Super-intel: Fix first checkpoint restart
authorMateusz Kusiak <mateusz.kusiak@intel.com>
Thu, 18 Jan 2024 10:30:17 +0000 (11:30 +0100)
committerMariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
Tue, 20 Feb 2024 13:05:03 +0000 (14:05 +0100)
commitfdb7e802f4cf64d067c3abaafa35056e2bc1ed43
treef8ed1993ebe262f443dae0d56d9ee1f93f3bcb47
parentcf87fe75fd83dac008ea116c2c52ec69783fdf6a
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>
super-intel.c