aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/zpool/zpool_main.c
diff options
context:
space:
mode:
authorTony Hutter <[email protected]>2018-10-09 20:30:32 -0700
committerBrian Behlendorf <[email protected]>2018-10-09 20:30:32 -0700
commit2ef0f8c3298ef02a68180fa3b16d84aa810a464a (patch)
treee2f40589b12f33c5a94ae737cdd1bc2dee32af5e /cmd/zpool/zpool_main.c
parent0391690583a8c5129477cbdac476130abe4af776 (diff)
Print "(repairing)" in zpool status again
Historically, zpool status prints "(repairing)" for any drives that have errors during a scrub: NAME STATE READ WRITE CKSUM mypool ONLINE 0 0 0 mirror-0 ONLINE 0 0 0 /tmp/file1 ONLINE 13 0 0 (repairing) /tmp/file2 ONLINE 0 0 0 /tmp/file3 ONLINE 0 0 0 This was accidentally broken in "OpenZFS 9166 - zfs storage pool checkpoint" (d2734cc). This patch adds it back in. Reviewed-by: Serapheim Dimitropoulos <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Tony Hutter <[email protected]> Closes #7779 Closes #7978
Diffstat (limited to 'cmd/zpool/zpool_main.c')
-rw-r--r--cmd/zpool/zpool_main.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/cmd/zpool/zpool_main.c b/cmd/zpool/zpool_main.c
index dfbfe0145..5af626558 100644
--- a/cmd/zpool/zpool_main.c
+++ b/cmd/zpool/zpool_main.c
@@ -1742,7 +1742,7 @@ static void
print_status_config(zpool_handle_t *zhp, status_cbdata_t *cb, const char *name,
nvlist_t *nv, int depth, boolean_t isspare)
{
- nvlist_t **child;
+ nvlist_t **child, *root;
uint_t c, children;
pool_scan_stat_t *ps = NULL;
vdev_stat_t *vs;
@@ -1868,7 +1868,10 @@ print_status_config(zpool_handle_t *zhp, status_cbdata_t *cb, const char *name,
}
}
- (void) nvlist_lookup_uint64_array(nv, ZPOOL_CONFIG_SCAN_STATS,
+ /* The root vdev has the scrub/resilver stats */
+ root = fnvlist_lookup_nvlist(zpool_get_config(zhp, NULL),
+ ZPOOL_CONFIG_VDEV_TREE);
+ (void) nvlist_lookup_uint64_array(root, ZPOOL_CONFIG_SCAN_STATS,
(uint64_t **)&ps, &c);
if (ps != NULL && ps->pss_state == DSS_SCANNING &&
@@ -1903,6 +1906,7 @@ print_status_config(zpool_handle_t *zhp, status_cbdata_t *cb, const char *name,
vname = zpool_vdev_name(g_zfs, zhp, child[c],
cb->cb_name_flags | VDEV_NAME_TYPE_ID);
+
print_status_config(zhp, cb, vname, child[c], depth + 2,
isspare);
free(vname);