diff options
author | Tom Caputi <[email protected]> | 2019-05-25 16:52:23 -0400 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2019-05-25 13:52:23 -0700 |
commit | 3b61ca3e57852a2d38f3524901df1f1801923c1d (patch) | |
tree | 99791fd8b41ea4db892ba968ad2b1b3efb6fb470 | |
parent | 8e3c3ed1b3b21d5510748a55852264c78fe24610 (diff) |
Fix embedded bp accounting in count_block()
Currently, count_block() does not correctly account for the
possibility that the bp that is passed to it could be embedded.
These blocks shouldn't be counted since the work of scanning
these blocks in already handled when the containing block is
scanned. This patch simply resolves this issue by returning
early in this case.
Reviewed by: Allan Jude <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Authored-by: Bill Sommerfeld <[email protected]>
Signed-off-by: Tom Caputi <[email protected]>
Closes #8800
Closes #8766
-rw-r--r-- | module/zfs/dsl_scan.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/module/zfs/dsl_scan.c b/module/zfs/dsl_scan.c index eee122aa6..b15c39ac9 100644 --- a/module/zfs/dsl_scan.c +++ b/module/zfs/dsl_scan.c @@ -3630,6 +3630,13 @@ count_block(dsl_scan_t *scn, zfs_all_blkstats_t *zab, const blkptr_t *bp) int i; /* + * Don't count embedded bp's, since we already did the work of + * scanning these when we scanned the containing block. + */ + if (BP_IS_EMBEDDED(bp)) + return; + + /* * Update the spa's stats on how many bytes we have issued. * Sequential scrubs create a zio for each DVA of the bp. Each * of these will include all DVAs for repair purposes, but the |