From b0bc7a84d90dcbf5321d48c5b24ed771c5a128b0 Mon Sep 17 00:00:00 2001 From: Max Grossman Date: Mon, 9 Dec 2013 10:37:51 -0800 Subject: Illumos 4370, 4371 4370 avoid transmitting holes during zfs send 4371 DMU code clean up Reviewed by: Matthew Ahrens Reviewed by: George Wilson Reviewed by: Christopher Siden Reviewed by: Josef 'Jeff' Sipek Approved by: Garrett D'Amore a References: https://www.illumos.org/issues/4370 https://www.illumos.org/issues/4371 https://github.com/illumos/illumos-gate/commit/43466aa Ported by: Tim Chase Signed-off-by: Brian Behlendorf Closes #2529 --- module/zfs/zil.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'module/zfs/zil.c') diff --git a/module/zfs/zil.c b/module/zfs/zil.c index b69a7bf56..b5ee395d1 100644 --- a/module/zfs/zil.c +++ b/module/zfs/zil.c @@ -395,7 +395,8 @@ zil_claim_log_block(zilog_t *zilog, blkptr_t *bp, void *tx, uint64_t first_txg) * Claim log block if not already committed and not already claimed. * If tx == NULL, just verify that the block is claimable. */ - if (bp->blk_birth < first_txg || zil_bp_tree_add(zilog, bp) != 0) + if (BP_IS_HOLE(bp) || bp->blk_birth < first_txg || + zil_bp_tree_add(zilog, bp) != 0) return (0); return (zio_wait(zio_claim(NULL, zilog->zl_spa, @@ -445,7 +446,8 @@ zil_free_log_record(zilog_t *zilog, lr_t *lrc, void *tx, uint64_t claim_txg) * If we previously claimed it, we need to free it. */ if (claim_txg != 0 && lrc->lrc_txtype == TX_WRITE && - bp->blk_birth >= claim_txg && zil_bp_tree_add(zilog, bp) == 0) + bp->blk_birth >= claim_txg && zil_bp_tree_add(zilog, bp) == 0 && + !BP_IS_HOLE(bp)) zio_free(zilog->zl_spa, dmu_tx_get_txg(tx), bp); return (0); -- cgit v1.2.3