aboutsummaryrefslogtreecommitdiffstats
path: root/module
diff options
context:
space:
mode:
authorPaul Zuchowski <[email protected]>2018-03-15 13:29:51 -0400
committerBrian Behlendorf <[email protected]>2018-03-15 10:29:51 -0700
commit1a2342784aeb15049a3d4926615adf3b85f0bce4 (patch)
tree4a1c4950e2601b948806f82d1fe3abc9b9f78b52 /module
parentde4f8d5d2620b550b99a7bdbfbeb49214a38dc79 (diff)
receive_spill does not byte swap spill contents
In zfs receive, the function receive_spill should account for spill block endian conversion as a defensive measure. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Tom Caputi <[email protected]> Signed-off-by: Paul Zuchowski <[email protected]> Closes #7300
Diffstat (limited to 'module')
-rw-r--r--module/zfs/dmu_send.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/module/zfs/dmu_send.c b/module/zfs/dmu_send.c
index f5894e6b8..d39ab1a9e 100644
--- a/module/zfs/dmu_send.c
+++ b/module/zfs/dmu_send.c
@@ -2977,6 +2977,15 @@ receive_spill(struct receive_writer_arg *rwa, struct drr_spill *drrs,
if (db_spill->db_size < drrs->drr_length)
VERIFY(0 == dbuf_spill_set_blksz(db_spill,
drrs->drr_length, tx));
+
+ if (rwa->byteswap && !arc_is_encrypted(abuf) &&
+ arc_get_compression(abuf) == ZIO_COMPRESS_OFF) {
+ dmu_object_byteswap_t byteswap =
+ DMU_OT_BYTESWAP(drrs->drr_type);
+ dmu_ot_byteswap[byteswap].ob_func(abuf->b_data,
+ DRR_SPILL_PAYLOAD_SIZE(drrs));
+ }
+
dbuf_assign_arcbuf((dmu_buf_impl_t *)db_spill, abuf, tx);
dmu_buf_rele(db, FTAG);