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 /cmd | |
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 'cmd')
-rw-r--r-- | cmd/zstreamdump/zstreamdump.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/cmd/zstreamdump/zstreamdump.c b/cmd/zstreamdump/zstreamdump.c index 4c33e0a5a..6c7150b10 100644 --- a/cmd/zstreamdump/zstreamdump.c +++ b/cmd/zstreamdump/zstreamdump.c @@ -614,6 +614,9 @@ main(int argc, char *argv[]) BSWAP_64(drrs->drr_compressed_size); drrs->drr_type = BSWAP_32(drrs->drr_type); } + + payload_size = DRR_SPILL_PAYLOAD_SIZE(drrs); + if (verbose) { sprintf_bytes(salt, drrs->drr_salt, ZIO_DATA_SALT_LEN); @@ -626,19 +629,21 @@ main(int argc, char *argv[]) "length = %llu flags = %u " "compression type = %u " "compressed_size = %llu " + "payload_size = %llu " "salt = %s iv = %s mac = %s\n", (u_longlong_t)drrs->drr_object, (u_longlong_t)drrs->drr_length, drrs->drr_flags, drrs->drr_compressiontype, (u_longlong_t)drrs->drr_compressed_size, + (u_longlong_t)payload_size, salt, iv, mac); } - (void) ssread(buf, drrs->drr_length, &zc); + (void) ssread(buf, payload_size, &zc); if (dump) { - print_block(buf, drrs->drr_length); + print_block(buf, payload_size); } break; case DRR_WRITE_EMBEDDED: |