diff options
author | Tom Caputi <[email protected]> | 2018-04-17 14:19:03 -0400 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2018-04-17 11:19:03 -0700 |
commit | b0ee5946aaee396c9c90b07f27504c39f6dec0ef (patch) | |
tree | a42c82fa515d8c15a84cc77f6001c1fccec62c5b /module/zfs | |
parent | e14a32b1c844d924b9f093375c0badcf10f61741 (diff) |
Fix issues with raw sends of spill blocks
This patch fixes 2 issues in how spill blocks are processed during
raw sends. The first problem is that compressed spill blocks were
using the logical length rather than the physical length to
determine how much data to dump into the send stream. The second
issue is a typo that caused the spill record's object number to be
used where the objset's ID number was required. Both issues have
been corrected, and the payload_size is now printed in zstreamdump
for future debugging.
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Tom Caputi <[email protected]>
Closes #7378
Closes #7432
Diffstat (limited to 'module/zfs')
-rw-r--r-- | module/zfs/dmu_send.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/module/zfs/dmu_send.c b/module/zfs/dmu_send.c index 6f3f6fde9..9422f3444 100644 --- a/module/zfs/dmu_send.c +++ b/module/zfs/dmu_send.c @@ -422,6 +422,7 @@ dump_spill(dmu_sendarg_t *dsp, const blkptr_t *bp, uint64_t object, void *data) { struct drr_spill *drrs = &(dsp->dsa_drr->drr_u.drr_spill); uint64_t blksz = BP_GET_LSIZE(bp); + uint64_t payload_size = blksz; if (dsp->dsa_pending_op != PENDING_NONE) { if (dump_record(dsp, NULL, 0) != 0) @@ -446,9 +447,10 @@ dump_spill(dmu_sendarg_t *dsp, const blkptr_t *bp, uint64_t object, void *data) drrs->drr_compressed_size = BP_GET_PSIZE(bp); zio_crypt_decode_params_bp(bp, drrs->drr_salt, drrs->drr_iv); zio_crypt_decode_mac_bp(bp, drrs->drr_mac); + payload_size = drrs->drr_compressed_size; } - if (dump_record(dsp, data, blksz) != 0) + if (dump_record(dsp, data, payload_size) != 0) return (SET_ERROR(EINTR)); return (0); } @@ -3395,7 +3397,7 @@ receive_read_record(struct receive_arg *ra) ra->byteswap; abuf = arc_loan_raw_buf(dmu_objset_spa(ra->os), - drrs->drr_object, byteorder, drrs->drr_salt, + dmu_objset_id(ra->os), byteorder, drrs->drr_salt, drrs->drr_iv, drrs->drr_mac, drrs->drr_type, drrs->drr_compressed_size, drrs->drr_length, drrs->drr_compressiontype); |