From e055647b456151a0081a9ee8b2a873d4b57e5611 Mon Sep 17 00:00:00 2001 From: Jorgen Lundman Date: Fri, 6 Oct 2017 12:04:30 +0900 Subject: [PATCH] Full diff against ZOL commits changes --- usr/src/uts/common/fs/zfs/arc.c | 12 ++++-------- usr/src/uts/common/fs/zfs/dmu_send.c | 2 -- usr/src/uts/common/fs/zfs/dsl_destroy.c | 3 +-- 3 files changed, 5 insertions(+), 12 deletions(-) diff --git a/usr/src/uts/common/fs/zfs/arc.c b/usr/src/uts/common/fs/zfs/arc.c index cecbf0e121fa..a6d14f27dd06 100644 --- a/usr/src/uts/common/fs/zfs/arc.c +++ b/usr/src/uts/common/fs/zfs/arc.c @@ -6318,6 +6318,8 @@ arc_write_ready(zio_t *zio) HDR_SET_PSIZE(hdr, psize); arc_hdr_set_compress(hdr, compress); + if (zio->io_error != 0 || psize == 0) + goto out; /* * Fill the hdr with data. If the buffer is encrypted we have no choice @@ -6334,6 +6336,7 @@ arc_write_ready(zio_t *zio) * the data into it; otherwise, we share the data directly if we can. */ if (ARC_BUF_ENCRYPTED(buf)) { + ASSERT3U(psize, >, 0); ASSERT(ARC_BUF_COMPRESSED(buf)); arc_hdr_alloc_pabd(hdr, B_TRUE); abd_copy(hdr->b_crypt_hdr.b_rabd, zio->io_abd, psize); @@ -6365,6 +6368,7 @@ arc_write_ready(zio_t *zio) arc_share_buf(hdr, buf); } +out: arc_hdr_verify(hdr, zio->io_bp); } @@ -6520,14 +6524,6 @@ arc_write(zio_t *pio, spa_t *spa, uint64_t txg, blkptr_t *bp, arc_buf_t *buf, zio_flags |= ZIO_FLAG_RAW_COMPRESS; } - if (ARC_BUF_ENCRYPTED(buf)) { - ASSERT(ARC_BUF_COMPRESSED(buf)); - zio_flags |= ZIO_FLAG_RAW; - } else if (ARC_BUF_COMPRESSED(buf)) { - ASSERT3U(zp->zp_compress, !=, ZIO_COMPRESS_OFF); - ASSERT3U(HDR_GET_LSIZE(hdr), !=, arc_buf_size(buf)); - zio_flags |= ZIO_FLAG_RAW_COMPRESS; - } callback = kmem_zalloc(sizeof (arc_write_callback_t), KM_SLEEP); callback->awcb_ready = ready; callback->awcb_children_ready = children_ready; diff --git a/usr/src/uts/common/fs/zfs/dmu_send.c b/usr/src/uts/common/fs/zfs/dmu_send.c index e4d68a06bec6..1c55b1e9c7e8 100644 --- a/usr/src/uts/common/fs/zfs/dmu_send.c +++ b/usr/src/uts/common/fs/zfs/dmu_send.c @@ -2708,8 +2708,6 @@ receive_spill(struct receive_writer_arg *rwa, struct drr_spill *drrs, if (drrs->drr_length < SPA_MINBLOCKSIZE || drrs->drr_length > spa_maxblocksize(dmu_objset_spa(rwa->os))) return (SET_ERROR(EINVAL)); - if (rwa->raw) - return (SET_ERROR(EINVAL)); if (rwa->raw) { if (!DMU_OT_IS_VALID(drrs->drr_type) || diff --git a/usr/src/uts/common/fs/zfs/dsl_destroy.c b/usr/src/uts/common/fs/zfs/dsl_destroy.c index 4417b89cf7e1..d76f67cea42f 100644 --- a/usr/src/uts/common/fs/zfs/dsl_destroy.c +++ b/usr/src/uts/common/fs/zfs/dsl_destroy.c @@ -828,8 +828,7 @@ dsl_destroy_head_sync_impl(dsl_dataset_t *ds, dmu_tx_t *tx) objset_t *os; VERIFY0(dmu_objset_from_ds(ds, &os)); - if (!spa_feature_is_enabled(dp->dp_spa, SPA_FEATURE_ASYNC_DESTROY) || - os->os_encrypted) { + if (!spa_feature_is_enabled(dp->dp_spa, SPA_FEATURE_ASYNC_DESTROY)) { old_synchronous_dataset_destroy(ds, tx); } else { /*