summaryrefslogtreecommitdiff
path: root/mdstat.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2010-11-22 19:35:25 +1100
committerNeilBrown <neilb@suse.de>2010-11-22 19:35:25 +1100
commitf94c116f56cb821bfd619481d94fcd78ab8b53c0 (patch)
tree423eb85d05606be21826afb51bdfc7f13193c2b1 /mdstat.c
parent8453e704305b92f043e436d6f90a0c5f068b09eb (diff)
detail/wait: better handling of monitoring sync action.
Detail: report reshape and check as well as resync and recovery Wait: if the resync is pending or delayed, wait for that too. Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'mdstat.c')
-rw-r--r--mdstat.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/mdstat.c b/mdstat.c
index 47be2bba..bb030bf3 100644
--- a/mdstat.c
+++ b/mdstat.c
@@ -241,11 +241,27 @@ struct mdstat_ent *mdstat_read(int hold, int start)
w[l-1] == '%' &&
(eq=strchr(w, '=')) != NULL ) {
ent->percent = atoi(eq+1);
- if (strncmp(w,"resync", 4)==0)
+ if (strncmp(w,"resync", 6)==0)
ent->resync = 1;
+ else if (strncmp(w, "reshape", 7)==0)
+ ent->resync = 2;
+ else
+ ent->resync = 0;
} else if (ent->percent == -1 &&
- strncmp(w, "resync", 4)==0) {
- ent->resync = 1;
+ (w[0] == 'r' || w[0] == 'c')) {
+ if (strncmp(w, "resync", 4)==0)
+ ent->resync = 1;
+ if (strncmp(w, "reshape", 7)==0)
+ ent->resync = 2;
+ if (strncmp(w, "recovery", 8)==0)
+ ent->resync = 2;
+ if (strncmp(w, "check", 5)==0)
+ ent->resync = 3;
+
+ if (l > 8 && strcmp(w+l-8, "=DELAYED"))
+ ent->percent = 0;
+ if (l > 8 && strcmp(w+l-8, "=PENDING"))
+ ent->percent = 0;
} else if (ent->percent == -1 &&
w[0] >= '0' &&
w[0] <= '9' &&