summaryrefslogtreecommitdiff
path: root/mdstat.c
diff options
context:
space:
mode:
authorKrzysztof Wojcik <krzysztof.wojcik@intel.com>2011-06-23 12:06:47 +1000
committerNeilBrown <neilb@suse.de>2011-06-23 12:06:47 +1000
commit2d3603ba0cb497429d2841d2fb4a5e36879e808b (patch)
tree899bc6fc7ab59828207e804c72fbb39a55c3d7a7 /mdstat.c
parentc281a8041977cdd4bd7eaed4e1fbead50b5640e6 (diff)
Show DELAYED, PENDING status of resync process in "--detail"
Initially there is no proper translation mdstat's DELAYED/PENDING processes to "--detail" output. For example, if we have recover=DELAYED in mdstat, "--detail" shows "State: recovering" and "Rebuild Status = 0%". It was incorrect in case of process waiting on checkpoint different than 0%. In fact rebuild status is differnt than 0% and user is misled. The patch fix the problem. Current "--detail" command shows in the exampe: "State: recovering (DELAYED)" and no information about precentage. Signed-off-by: Krzysztof Wojcik <krzysztof.wojcik@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'mdstat.c')
-rw-r--r--mdstat.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/mdstat.c b/mdstat.c
index 3d2edadb..abf6bf95 100644
--- a/mdstat.c
+++ b/mdstat.c
@@ -257,10 +257,10 @@ struct mdstat_ent *mdstat_read(int hold, int start)
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;
+ if (l > 8 && strcmp(w+l-8, "=DELAYED") == 0)
+ ent->percent = PROCESS_DELAYED;
+ if (l > 8 && strcmp(w+l-8, "=PENDING") == 0)
+ ent->percent = PROCESS_PENDING;
} else if (ent->percent == -1 &&
w[0] >= '0' &&
w[0] <= '9' &&