Skip to content

Commit

Permalink
Illumos #3995
Browse files Browse the repository at this point in the history
3995 Memory leak of compressed buffers in l2arc_write_done

References:
  https://illumos.org/issues/3995

Ported-by: Richard Yao <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Closes #1688
Issue #1775
  • Loading branch information
Saso Kiselkov authored and behlendorf committed Nov 5, 2013
1 parent 43a696e commit 1ca546b
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions module/zfs/arc.c
Original file line number Diff line number Diff line change
Expand Up @@ -4487,6 +4487,13 @@ l2arc_write_done(zio_t *zio)
*/
for (ab = list_prev(buflist, head); ab; ab = ab_prev) {
ab_prev = list_prev(buflist, ab);
abl2 = ab->b_l2hdr;

/*
* Release the temporary compressed buffer as soon as possible.
*/
if (abl2->b_compress != ZIO_COMPRESS_OFF)
l2arc_release_cdata_buf(ab);

hash_lock = HDR_LOCK(ab);
if (!mutex_tryenter(hash_lock)) {
Expand All @@ -4499,14 +4506,6 @@ l2arc_write_done(zio_t *zio)
continue;
}

abl2 = ab->b_l2hdr;

/*
* Release the temporary compressed buffer as soon as possible.
*/
if (abl2->b_compress != ZIO_COMPRESS_OFF)
l2arc_release_cdata_buf(ab);

if (zio->io_error != 0) {
/*
* Error - drop L2ARC entry.
Expand Down

0 comments on commit 1ca546b

Please sign in to comment.