]> git.ipfire.org Git - thirdparty/mdadm.git/commit
mdadm: Do not start reshape before switchroot
authorMateusz Kusiak <mateusz.kusiak@intel.com>
Thu, 10 Oct 2024 10:31:06 +0000 (10:31 +0000)
committerMariusz Tkaczyk <mtkaczyk@kernel.org>
Mon, 13 Jan 2025 09:24:49 +0000 (10:24 +0100)
commit8a0d3fea424c1c19c51993c0849ea76ea41e8003
treed45b48936296e2d1c5eae446937c344023c023af
parent25267bcc1eb403b2d837069289990afdc097031f
mdadm: Do not start reshape before switchroot

There are numerous issues for --grow --continue in switchroot phrase,
they include:
* Events being missed for restarting grow-continue service. This is
  apparent mostly on OS on RAID scenarios. When a checkpoint (next step)
  is committed, we have no reliable way to gracefully stop reshape until
  it reaches that checkpoint. During boot, there's heavy I/O utilisation,
  which causes sync speed drop, and naturally checkpoint takes longer to
  reach. This further causes systemd to forcefully kill grow-continue
  service due to timeouts, which results in udev event being missed for
  grow-continue service restart.
* Grow-continue (seemingly) was not designed to be restarted without
  reassembly, some things like stopping chunksize (to lower) migration
  were straight up not working until recently.
This patch makes grow-continue (actual reshape) start after switchroot
phrase. This way we should not encounter issues related to restarting
the service.

Add checks not start a reshape if in initrd, let it initialise only.
Change grow-continue udev rule to be triggered whenever there's a
reshape happening in metadata, rely on udev event to kick reshape after
switchroot. Add handle_forking helper function for reshapes to avoid
duplicating code.

Signed-off-by: Mateusz Kusiak <mateusz.kusiak@intel.com>
Grow.c
mdadm_status.h
udev-md-raid-arrays.rules
util.c