summaryrefslogtreecommitdiffstats
path: root/monitor.c
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2009-04-12 00:58:28 -0700
committerDan Williams <dan.j.williams@intel.com>2009-04-12 00:58:28 -0700
commit7e7fffc4022114c491587755998395ef4766fcc2 (patch)
tree2384efbcf8dae9a327412f14f5762437fbd02173 /monitor.c
parent48924014b02dd0e8046f58a4c6c9a2903a9b1dbd (diff)
downloadmdadm-7e7fffc4022114c491587755998395ef4766fcc2.tar.gz
mdadm-7e7fffc4022114c491587755998395ef4766fcc2.tar.xz
mdadm-7e7fffc4022114c491587755998395ef4766fcc2.zip
mdmon: fix resync completion detection
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>
Diffstat (limited to 'monitor.c')
-rw-r--r--monitor.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/monitor.c b/monitor.c
index 62261d9..3388d31 100644
--- 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;
}