]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Monitor: don't get confused if utime is never set.
authorNeilBrown <neilb@suse.de>
Tue, 2 Jun 2009 04:24:58 +0000 (14:24 +1000)
committerNeilBrown <neilb@suse.de>
Tue, 2 Jun 2009 04:24:58 +0000 (14:24 +1000)
externally managed arrays do not (currently) cause utime in
GET_ARRAY_INFO to be updated.  So if it is zero, just assume the
current time.
This will cause GET_DISK_INFO to be called more often, but as we do
the scan only every 60 seconds normally, a few extra syscalls isn't
going to make a big difference.

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

index e43175f186d878acc6c0f5591ea1187f5bc8e0b9..92aaf65573f8eed876f82270ee8a7d84de154c17 100644 (file)
--- a/Monitor.c
+++ b/Monitor.c
@@ -284,6 +284,10 @@ int Monitor(mddev_dev_t devlist,
                                        mse = mse2;
                                }
 
+                       if (array.utime == 0)
+                               /* external arrays don't update utime */
+                               array.utime = time(0);
+
                        if (st->utime == array.utime &&
                            st->failed == array.failed_disks &&
                            st->working == array.working_disks &&