]> granicus.if.org Git - zfs/commitdiff
Fix embedded bp accounting in count_block()
authorTom Caputi <tcaputi@datto.com>
Sat, 25 May 2019 20:52:23 +0000 (16:52 -0400)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 7 Jun 2019 19:39:13 +0000 (12:39 -0700)
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 <allanjude@freebsd.org>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Authored-by: Bill Sommerfeld <sommerfeld@alum.mit.edu>
Signed-off-by: Tom Caputi <tcaputi@datto.com>
Closes #8800
Closes #8766

module/zfs/dsl_scan.c

index eee122aa6d28a8cb0b9841136a61fcd5716dac66..b15c39ac9ca9131e6fe6d7615a4ee057a07b7910 100644 (file)
@@ -3629,6 +3629,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