From 3db6627c6730f7ec4426ac0be0e9338235aed2d8 Mon Sep 17 00:00:00 2001 From: Tom Caputi Date: Wed, 1 May 2019 20:34:24 -0400 Subject: 10900 Fix estimated scrub completion time Reviewed by: Jerry Jelinek Reviewed by: C Fraire Approved by: Dan McDonald --- usr/src/cmd/zpool/zpool_main.c | 5 +++-- usr/src/man/man1m/zpool.1m | 4 ++++ 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'usr/src') diff --git a/usr/src/cmd/zpool/zpool_main.c b/usr/src/cmd/zpool/zpool_main.c index 013ef1c699..9f4296027c 100644 --- a/usr/src/cmd/zpool/zpool_main.c +++ b/usr/src/cmd/zpool/zpool_main.c @@ -4804,7 +4804,7 @@ print_scan_status(pool_scan_stat_t *ps) scan_rate = pass_scanned / elapsed; issue_rate = pass_issued / elapsed; - total_secs_left = (issue_rate != 0) ? + total_secs_left = (issue_rate != 0 && total >= issued) ? ((total - issued) / issue_rate) : UINT64_MAX; days_left = total_secs_left / 60 / 60 / 24; @@ -4838,7 +4838,8 @@ print_scan_status(pool_scan_stat_t *ps) } if (pause == 0) { - if (issue_rate >= 10 * 1024 * 1024) { + if (total_secs_left != UINT64_MAX && + issue_rate >= 10 * 1024 * 1024) { (void) printf(gettext(", %llu days " "%02llu:%02llu:%02llu to go\n"), (u_longlong_t)days_left, (u_longlong_t)hours_left, diff --git a/usr/src/man/man1m/zpool.1m b/usr/src/man/man1m/zpool.1m index 5abbbcc018..f07bf81bd0 100644 --- a/usr/src/man/man1m/zpool.1m +++ b/usr/src/man/man1m/zpool.1m @@ -1808,6 +1808,10 @@ If a scrub is paused, the resumes it. If a resilver is in progress, ZFS does not allow a scrub to be started until the resilver completes. +.Pp +Note that, due to changes in pool data on a live system, it is possible for +scrubs to progress slightly beyond 100% completion. +During this period, no completion time estimate will be provided. .Bl -tag -width Ds .It Fl s Stop scrubbing. -- cgit v1.2.3