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>
This commit is contained in:
Dan Williams 2009-04-12 00:58:28 -07:00
parent 48924014b0
commit 7e7fffc402
1 changed files with 4 additions and 2 deletions

View File

@ -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;
}