diff options
author | NeilBrown <neilb@suse.de> | 2008-07-18 16:37:06 +1000 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2008-07-18 16:37:06 +1000 |
commit | 1eb252b8488bbdd62ad602561fe8a90ef9079271 (patch) | |
tree | e5281b6756936f74ea4cde5dbb835063f1e6a3ba /monitor.c | |
parent | 103f2410ec581620367d6fde67a3a62f077062a7 (diff) | |
download | mdadm-1eb252b8488bbdd62ad602561fe8a90ef9079271.tar.gz mdadm-1eb252b8488bbdd62ad602561fe8a90ef9079271.tar.xz mdadm-1eb252b8488bbdd62ad602561fe8a90ef9079271.zip |
mdmon: ping will wait for manage_mon to catch up.
When a 'ping' (empty message) is sent to mdmon, we wait for
'monitor' to do a full loop to make sure it has caught up
with anything that needs doing.
This allows synchronisation between mdadm and mdmon.
Maybe monitor should signal managemon rather than managemon polling...
Signed-off-by: Neil Brown <neilb@suse.de>
Diffstat (limited to 'monitor.c')
-rw-r--r-- | monitor.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -405,6 +405,8 @@ static void dprint_wake_reasons(fd_set *fds) } #endif +int monitor_loop_cnt; + static int wait_and_act(struct supertype *container, int nowait) { fd_set rfds; @@ -462,7 +464,9 @@ static int wait_and_act(struct supertype *container, int nowait) sigset_t set; sigprocmask(SIG_UNBLOCK, NULL, &set); sigdelset(&set, SIGUSR1); + monitor_loop_cnt |= 1; rv = pselect(maxfd+1, &rfds, NULL, NULL, NULL, &set); + monitor_loop_cnt += 1; if (rv == -1 && errno == EINTR) rv = 0; #ifdef DEBUG |