]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
mdmon: fix resync completion detection
authorDan Williams <dan.j.williams@intel.com>
Sun, 12 Apr 2009 07:58:28 +0000 (00:58 -0700)
committerDan Williams <dan.j.williams@intel.com>
Sun, 12 Apr 2009 07:58:28 +0000 (00:58 -0700)
Starting with 2.6.30 the md/resync_start attribute will no longer return
a non-sensical number when resync is complete, instead it now returns
'none'.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
monitor.c

index 62261d963fe89a25593de63c2172cbf6fe13fc85..3388d31c5c57aaab6d60fde1ef04e7dd940743eb 100644 (file)
--- a/monitor.c
+++ b/monitor.c
@@ -74,8 +74,10 @@ int get_resync_start(struct active_array *a)
        n = read_attr(buf, 30, a->resync_start_fd);
        if (n <= 0)
                return n;
-
-       a->resync_start = strtoull(buf, NULL, 10);
+       if (strncmp(buf, "none", 4) == 0)
+               a->resync_start = ~0ULL;
+       else
+               a->resync_start = strtoull(buf, NULL, 10);
 
        return 1;
 }