summaryrefslogtreecommitdiff
path: root/Detail.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 /Detail.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 'Detail.c')
-rw-r--r--Detail.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/Detail.c b/Detail.c
index 40806cf0..ca34abea 100644
--- a/Detail.c
+++ b/Detail.c
@@ -372,11 +372,13 @@ int Detail(char *dev, int brief, int export, int test, char *homehost)
else
st = ", degraded";
- printf(" State : %s%s%s%s\n",
- (array.state&(1<<MD_SB_CLEAN))?"clean":"active",
- st,
- (!e || e->percent < 0) ? "" : sync_action[e->resync],
- larray_size ? "": ", Not Started");
+ printf(" State : %s%s%s%s%s%s \n",
+ (array.state&(1<<MD_SB_CLEAN))?"clean":"active", st,
+ (!e || (e->percent < 0 && e->percent != PROCESS_PENDING &&
+ e->percent != PROCESS_DELAYED)) ? "" : sync_action[e->resync],
+ larray_size ? "": ", Not Started",
+ e->percent == PROCESS_DELAYED ? " (DELAYED)": "",
+ e->percent == PROCESS_PENDING ? " (PENDING)": "");
}
if (array.raid_disks)
printf(" Active Devices : %d\n", array.active_disks);
@@ -416,10 +418,8 @@ int Detail(char *dev, int brief, int export, int test, char *homehost)
}
if (e && e->percent >= 0) {
- printf(" Re%s Status : %d%% complete\n",
- (st && st->sb && info->reshape_active)?
- "shape":"build",
- e->percent);
+ static char *sync_action[] = {"Rebuild", "Resync", "Reshape", "Check"};
+ printf(" %7s Status : %d%% complete\n", sync_action[e->resync], e->percent);
is_rebuilding = 1;
}
free_mdstat(ms);