]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Monitor: reduce default poll interval if mdstat is pollable.
authorNeilBrown <neilb@suse.de>
Tue, 2 Jun 2009 04:35:44 +0000 (14:35 +1000)
committerNeilBrown <neilb@suse.de>
Tue, 2 Jun 2009 04:35:44 +0000 (14:35 +1000)
Since 2.6.16, mdstat responds to select/poll.
So in that case, increase the default poll interval to about 15
minutes.
This ensures that the background load is insignificant.

Signed-off-by: NeilBrown <neilb@suse.de>
mdadm.c

diff --git a/mdadm.c b/mdadm.c
index 0478ce96a1b099bb2a0caaa88014716053f7ca95..fee7fd92fd859361c6870cfb5ee53291734f5555 100644 (file)
--- a/mdadm.c
+++ b/mdadm.c
@@ -1373,6 +1373,13 @@ int main(int argc, char *argv[])
                        rv = 1;
                        break;
                }
+               if (delay == 0) {
+                       if (get_linux_version() > 20616)
+                               /* mdstat responds to poll */
+                               delay = 1000;
+                       else
+                               delay = 60;
+               }
                rv= Monitor(devlist, mailaddr, program,
                            delay?delay:60, daemonise, scan, oneshot,
                            dosyslog, test, pidfile);