]> git.ipfire.org Git - thirdparty/mdadm.git/commit - super-intel.c
imsm: finish recovery when drive with rebuild fails
authorMariusz Tkaczyk <mariusz.tkaczyk@intel.com>
Fri, 8 Feb 2019 10:07:10 +0000 (11:07 +0100)
committerJes Sorensen <jsorensen@fb.com>
Mon, 11 Feb 2019 19:33:49 +0000 (14:33 -0500)
commita4e96fd8f3f0b5416783237c1cb6ee87e7eff23d
tree9e644169ff8e5596ce8066fd0cafab3ebf4bed6c
parent757e55435997e355ee9b03e5d913b5496a3c39a8
imsm: finish recovery when drive with rebuild fails

Commit d7a1fda2769b ("imsm: update metadata correctly while raid10 double
degradation") resolves main Imsm double degradation problems but it
omits one case. Now metadata hangs in the rebuilding state if the drive
under rebuild is removed during recovery from double degradation.

The root cause of this problem is comparing new map_state with current
and if they both are degraded assuming that nothing new happens.

Don't rely on map states, just check if device is failed. If the drive
under rebuild fails then finish migration, in other cases update map
state only (second fail means that destination map state can't be normal).

To avoid problems with reassembling move end_migration (called after
double degradation successful recovery) after check if recovery really
finished, for details see (7ce057018 "imsm: fix: rebuild does not
continue after reboot").
Remove redundant code responsible for finishing rebuild process. Function
end_migration do exactly the same. Set last_checkpoint to 0, to prepare
it for the next rebuild.

Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@intel.com>
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
super-intel.c