Skip to content

Commit 1ca546b

Browse files
Saso Kiselkovbehlendorf
authored andcommitted
Illumos #3995
3995 Memory leak of compressed buffers in l2arc_write_done References: https://illumos.org/issues/3995 Ported-by: Richard Yao <ryao@gentoo.org> Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Closes #1688 Issue #1775
1 parent 43a696e commit 1ca546b

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

module/zfs/arc.c

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4487,6 +4487,13 @@ l2arc_write_done(zio_t *zio)
44874487
*/
44884488
for (ab = list_prev(buflist, head); ab; ab = ab_prev) {
44894489
ab_prev = list_prev(buflist, ab);
4490+
abl2 = ab->b_l2hdr;
4491+
4492+
/*
4493+
* Release the temporary compressed buffer as soon as possible.
4494+
*/
4495+
if (abl2->b_compress != ZIO_COMPRESS_OFF)
4496+
l2arc_release_cdata_buf(ab);
44904497

44914498
hash_lock = HDR_LOCK(ab);
44924499
if (!mutex_tryenter(hash_lock)) {
@@ -4499,14 +4506,6 @@ l2arc_write_done(zio_t *zio)
44994506
continue;
45004507
}
45014508

4502-
abl2 = ab->b_l2hdr;
4503-
4504-
/*
4505-
* Release the temporary compressed buffer as soon as possible.
4506-
*/
4507-
if (abl2->b_compress != ZIO_COMPRESS_OFF)
4508-
l2arc_release_cdata_buf(ab);
4509-
45104509
if (zio->io_error != 0) {
45114510
/*
45124511
* Error - drop L2ARC entry.

0 commit comments

Comments
 (0)