diff options
author | Tom Caputi <tcaputi@datto.com> | 2019-05-01 20:34:24 -0400 |
---|---|---|
committer | Toomas Soome <tsoome@me.com> | 2019-05-13 23:49:36 +0300 |
commit | 3db6627c6730f7ec4426ac0be0e9338235aed2d8 (patch) | |
tree | c9fbf24d1fe4aca3db90e9a76da66327bc3527c6 /usr/src | |
parent | 12a8814c13fbb1d6d58616cf090ea5815dc107f9 (diff) | |
download | illumos-gate-3db6627c6730f7ec4426ac0be0e9338235aed2d8.tar.gz |
10900 Fix estimated scrub completion time
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>
Reviewed by: C Fraire <cfraire@me.com>
Approved by: Dan McDonald <danmcd@joyent.com>
Diffstat (limited to 'usr/src')
-rw-r--r-- | usr/src/cmd/zpool/zpool_main.c | 5 | ||||
-rw-r--r-- | usr/src/man/man1m/zpool.1m | 4 |
2 files changed, 7 insertions, 2 deletions
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. |