From b0ee5946aaee396c9c90b07f27504c39f6dec0ef Mon Sep 17 00:00:00 2001 From: Tom Caputi Date: Tue, 17 Apr 2018 14:19:03 -0400 Subject: 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 Signed-off-by: Tom Caputi Closes #7378 Closes #7432 --- cmd/zstreamdump/zstreamdump.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'cmd') 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: -- cgit v1.2.3