diff --git a/include/sys/zio.h b/include/sys/zio.h index 9ae755168991..d3b95e17093f 100644 --- a/include/sys/zio.h +++ b/include/sys/zio.h @@ -477,7 +477,7 @@ extern zio_t *zio_write_phys(zio_t *pio, vdev_t *vd, uint64_t offset, boolean_t labels); extern zio_t *zio_free_sync(zio_t *pio, spa_t *spa, uint64_t txg, - const blkptr_t *bp, enum zio_flag flags); + const blkptr_t *bp, uint64_t size, enum zio_flag flags); extern int zio_alloc_zil(spa_t *spa, uint64_t txg, blkptr_t *new_bp, blkptr_t *old_bp, uint64_t size, boolean_t use_slog); diff --git a/module/zfs/dsl_scan.c b/module/zfs/dsl_scan.c index 07e3dec1ecec..91b467e6ccee 100644 --- a/module/zfs/dsl_scan.c +++ b/module/zfs/dsl_scan.c @@ -360,7 +360,8 @@ void dsl_free_sync(zio_t *pio, dsl_pool_t *dp, uint64_t txg, const blkptr_t *bpp) { ASSERT(dsl_pool_sync_context(dp)); - zio_nowait(zio_free_sync(pio, dp->dp_spa, txg, bpp, pio->io_flags)); + zio_nowait(zio_free_sync(pio, dp->dp_spa, txg, bpp, BP_GET_PSIZE(bpp), + pio->io_flags)); } int @@ -1431,7 +1432,7 @@ dsl_scan_free_cb(void *arg, const blkptr_t *bp, dmu_tx_t *tx) return (ERESTART); zio_nowait(zio_free_sync(scn->scn_zio_root, scn->scn_dp->dp_spa, - dmu_tx_get_txg(tx), bp, 0)); + dmu_tx_get_txg(tx), bp, BP_GET_PSIZE(bp), 0)); dsl_dir_diduse_space(tx->tx_pool->dp_free_dir, DD_USED_HEAD, -bp_get_dsize_sync(scn->scn_dp->dp_spa, bp), -BP_GET_PSIZE(bp), -BP_GET_UCSIZE(bp), tx); diff --git a/module/zfs/spa.c b/module/zfs/spa.c index 04b3cfb361e5..16df287acb7f 100644 --- a/module/zfs/spa.c +++ b/module/zfs/spa.c @@ -5288,7 +5288,7 @@ spa_free_sync_cb(void *arg, const blkptr_t *bp, dmu_tx_t *tx) zio_t *zio = arg; zio_nowait(zio_free_sync(zio, zio->io_spa, dmu_tx_get_txg(tx), bp, - zio->io_flags)); + BP_GET_PSIZE(bp), zio->io_flags)); return (0); } diff --git a/module/zfs/zio.c b/module/zfs/zio.c index 0cc98687daf4..76d48aa4f9c5 100644 --- a/module/zfs/zio.c +++ b/module/zfs/zio.c @@ -757,7 +757,7 @@ zio_free(spa_t *spa, uint64_t txg, const blkptr_t *bp) zio_t * zio_free_sync(zio_t *pio, spa_t *spa, uint64_t txg, const blkptr_t *bp, - enum zio_flag flags) + uint64_t size, enum zio_flag flags) { zio_t *zio; @@ -768,7 +768,7 @@ zio_free_sync(zio_t *pio, spa_t *spa, uint64_t txg, const blkptr_t *bp, ASSERT(spa_syncing_txg(spa) == txg); ASSERT(spa_sync_pass(spa) <= SYNC_PASS_DEFERRED_FREE); - zio = zio_create(pio, spa, txg, bp, NULL, BP_GET_PSIZE(bp), + zio = zio_create(pio, spa, txg, bp, NULL, size, NULL, NULL, ZIO_TYPE_FREE, ZIO_PRIORITY_FREE, flags, NULL, 0, NULL, ZIO_STAGE_OPEN, ZIO_FREE_PIPELINE); @@ -1594,7 +1594,7 @@ zio_t * zio_free_gang(zio_t *pio, blkptr_t *bp, zio_gang_node_t *gn, void *data) { return (zio_free_sync(pio, pio->io_spa, pio->io_txg, bp, - ZIO_GANG_CHILD_FLAGS(pio))); + SPA_GANGBLOCKSIZE, ZIO_GANG_CHILD_FLAGS(pio))); } /* ARGSUSED */ @@ -1730,7 +1730,7 @@ zio_gang_tree_issue(zio_t *pio, zio_gang_node_t *gn, blkptr_t *bp, void *data) } } - if (gn == gio->io_gang_tree) + if (gn == gio->io_gang_tree && gio->io_data != NULL) ASSERT3P((char *)gio->io_data + gio->io_size, ==, data); if (zio != pio)