Skip to content

Commit 8eac845

Browse files
committed
Don't skip encryption stage because of insufficient compression gains
Signed-off-by: Allan Jude <allanjude@freebsd.org>
1 parent 1f565ef commit 8eac845

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

module/zfs/arc.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8725,14 +8725,14 @@ l2arc_apply_transforms(spa_t *spa, arc_buf_hdr_t *hdr, uint64_t asize,
87258725
hdr->b_complevel);
87268726

87278727
if (psize >= size) {
8728+
abd_return_buf(cabd, tmp, asize);
8729+
abd_free(cabd);
87288730
HDR_SET_COMPRESS(hdr, ZIO_COMPRESS_OFF);
87298731
to_write = abd_alloc_for_io(asize, ismd);
87308732
abd_copy(to_write, hdr->b_l1hdr.b_pabd, size);
87318733
if (size != asize)
87328734
abd_zero_off(to_write, size, asize - size);
8733-
if (cabd != NULL)
8734-
abd_free(cabd);
8735-
goto out;
8735+
goto encrypt;
87368736
}
87378737
ASSERT3U(psize, <=, HDR_GET_PSIZE(hdr));
87388738
if (psize < asize)
@@ -8742,6 +8742,7 @@ l2arc_apply_transforms(spa_t *spa, arc_buf_hdr_t *hdr, uint64_t asize,
87428742
to_write = cabd;
87438743
}
87448744

8745+
encrypt:
87458746
if (HDR_ENCRYPTED(hdr)) {
87468747
eabd = abd_alloc_for_io(asize, ismd);
87478748

0 commit comments

Comments
 (0)