summaryrefslogtreecommitdiffstats
path: root/mdmon.h
diff options
context:
space:
mode:
authorTomasz Majchrzak <tomasz.majchrzak@intel.com>2017-10-04 10:18:21 +0200
committerJes Sorensen <jsorensen@fb.com>2017-10-04 11:41:57 -0400
commitc76242c56efb4d799bb15af1035a5f503cb4b8f3 (patch)
tree2ebf7ccd831e48a603448d1ed62269fb14da736d /mdmon.h
parent20dc76d15b40c17b4ccdc3d6283af8ecb513707f (diff)
downloadmdadm-c76242c56efb4d799bb15af1035a5f503cb4b8f3.tar.gz
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.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/mdmon.h b/mdmon.h
index 0b08c3d7..818367cb 100644
--- a/mdmon.h
+++ b/mdmon.h
@@ -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