]> git.ipfire.org Git - thirdparty/mdadm.git/commit - managemon.c
mdmon: get safe mode delay file descriptor early
authorTomasz Majchrzak <tomasz.majchrzak@intel.com>
Wed, 4 Oct 2017 08:18:21 +0000 (10:18 +0200)
committerJes Sorensen <jsorensen@fb.com>
Wed, 4 Oct 2017 15:41:57 +0000 (11:41 -0400)
commitc76242c56efb4d799bb15af1035a5f503cb4b8f3
tree2ebf7ccd831e48a603448d1ed62269fb14da736d
parent20dc76d15b40c17b4ccdc3d6283af8ecb513707f
mdmon: get safe mode delay file descriptor early

After switch root new mdmon is started. It sends initrd mdmon a signal
to terminate. initrd mdmon receives it and switches the safe mode delay
to 1 ms in order to get array to clean state and flush last version of
metadata. The problem is sysfs filesystem is not available to initrd mdmon
after switch root so the original safe mode delay is unchanged. The delay
is set to few seconds - if there is a lot of traffic on the filesystem,
initrd mdmon doesn't terminate for a long time (no clean state). There
are 2 instances of mdmon. initrd mdmon flushes metadata when array goes
to clean state but this metadata might be already outdated.

Use file descriptor obtained on mdmon start to change safe mode delay.

Signed-off-by: Tomasz Majchrzak <tomasz.majchrzak@intel.com>
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
managemon.c
mdmon.h