HomeFreeBSD

dsl_scan_scrub_cb: don't double-account non-embedded blocks

Description

dsl_scan_scrub_cb: don't double-account non-embedded blocks

We were doing count_block() twice inside this function, once
unconditionally at the beginning (intended to catch the embedded block
case) and once near the end after processing the block.

The double-accounting caused the "zpool scrub" progress statistics in
"zpool status" to climb from 0% to 200% instead of 0% to 100%, and
showed double the I/O rate it was actually seeing.

This was apparently a regression introduced in commit 00c405b4b5e8,
which was an incorrect port of this OpenZFS commit:

    https://github.com/openzfs/openzfs/commit/d8a447a7

Reviewed by: Thomas Caputi <tcaputi@datto.com>
Reviewed by: Matt Ahrens <matt@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: George Melikov <mail@gmelikov.ru>
Signed-off-by: Steven Noonan <steven@uplinklabs.net>
Closes #7720
Closes #7738

Details

Provenance
Steven Noonan <steven@uplinklabs.net>Authored on Jul 24 2018, 4:33 PM
Brian Behlendorf <behlendorf1@llnl.gov>Committed on Jul 24 2018, 4:33 PM
Parents
rGfda0f1621715: PR's should provide motivation & context first
Branches
Unknown
Tags
Unknown

Event Timeline

Brian Behlendorf <behlendorf1@llnl.gov> committed rG863522b1f923: dsl_scan_scrub_cb: don't double-account non-embedded blocks (authored by Steven Noonan <steven@uplinklabs.net>).Jul 24 2018, 4:33 PM