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 <behlendorf1@llnl.gov>
Signed-off-by: Tom Caputi <tcaputi@datto.com>
Closes #7378 
Closes #7432
This commit is contained in:
Tom Caputi
2018-04-17 14:19:03 -04:00
committed by Brian Behlendorf
parent e14a32b1c8
commit b0ee5946aa
3 changed files with 20 additions and 7 deletions
+7 -2
View File
@@ -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: