diff options
author | Steven Noonan <[email protected]> | 2018-07-24 09:33:56 -0700 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2018-07-24 09:33:56 -0700 |
commit | 863522b1f9235398f6c28ee3ab96f7d1c9088450 (patch) | |
tree | d47405222e26269ae0d6974e1cca474b0c3d10d8 | |
parent | fda0f162171585891d7865bc7bd5e49255b4564b (diff) |
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 <[email protected]>
Reviewed by: Matt Ahrens <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: George Melikov <[email protected]>
Signed-off-by: Steven Noonan <[email protected]>
Closes #7720
Closes #7738
-rw-r--r-- | module/zfs/dsl_scan.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/module/zfs/dsl_scan.c b/module/zfs/dsl_scan.c index a08353c15..f3c869538 100644 --- a/module/zfs/dsl_scan.c +++ b/module/zfs/dsl_scan.c @@ -3565,11 +3565,12 @@ dsl_scan_scrub_cb(dsl_pool_t *dp, boolean_t needs_io = B_FALSE; int zio_flags = ZIO_FLAG_SCAN_THREAD | ZIO_FLAG_RAW | ZIO_FLAG_CANFAIL; - count_block(scn, dp->dp_blkstats, bp); if (phys_birth <= scn->scn_phys.scn_min_txg || - phys_birth >= scn->scn_phys.scn_max_txg) + phys_birth >= scn->scn_phys.scn_max_txg) { + count_block(scn, dp->dp_blkstats, bp); return (0); + } /* Embedded BP's have phys_birth==0, so we reject them above. */ ASSERT(!BP_IS_EMBEDDED(bp)); |