if (atime)
printf(" Update Time : %.24s\n", ctime(&atime));
if (array.raid_disks) {
+ static char *sync_action[] = {", recovering",", resyncing",", reshaping",", checking"};
char *st;
if (avail_disks == array.raid_disks)
st = "";
printf(" State : %s%s%s%s\n",
(array.state&(1<<MD_SB_CLEAN))?"clean":"active",
st,
- (!e || e->percent < 0) ? "" :
- (e->resync) ? ", resyncing": ", recovering",
+ (!e || e->percent < 0) ? "" : sync_action[e->resync],
larray_size ? "": ", Not Started");
}
if (array.raid_disks)
char *level;
char *pattern; /* U or up, _ for down */
int percent; /* -1 if no resync */
- int resync; /* 1 if resync, 0 if recovery */
+ int resync; /* 3 if check, 2 if reshape, 1 if resync, 0 if recovery */
int devcnt;
int raid_disks;
int chunk_size;
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' &&