diff options
author | Tomasz Majchrzak <tomasz.majchrzak@intel.com> | 2017-10-04 10:18:21 +0200 |
---|---|---|
committer | Jes Sorensen <jsorensen@fb.com> | 2017-10-04 17:41:57 +0200 |
commit | c76242c56efb4d799bb15af1035a5f503cb4b8f3 (patch) | |
tree | 2ebf7ccd831e48a603448d1ed62269fb14da736d /mdmon.h | |
parent | imsm: Set disk slot number (diff) | |
download | mdadm-c76242c56efb4d799bb15af1035a5f503cb4b8f3.tar.xz mdadm-c76242c56efb4d799bb15af1035a5f503cb4b8f3.zip |
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>
Diffstat (limited to 'mdmon.h')
-rw-r--r-- | mdmon.h | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -35,6 +35,7 @@ struct active_array { int resync_start_fd; int metadata_fd; /* for monitoring rw/ro status */ int sync_completed_fd; /* for checkpoint notification events */ + int safe_mode_delay_fd; unsigned long long last_checkpoint; /* sync_completed fires for many * reasons this field makes sure the * kernel has made progress before |