diff options
author | Saso Kiselkov <[email protected]> | 2013-10-14 18:29:45 -0400 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2013-11-05 12:26:00 -0800 |
commit | 1ca546b33888b8f4c7e737faf8f038732926fd6e (patch) | |
tree | 61bde6ded893cf820562eb7f42c053b765dc0965 /module/zfs/arc.c | |
parent | 43a696ed38cae25ec2d7b6466ab4a99eb86df7bd (diff) |
Illumos #3995
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
Diffstat (limited to 'module/zfs/arc.c')
-rw-r--r-- | module/zfs/arc.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/module/zfs/arc.c b/module/zfs/arc.c index 5bba9a317..6aa7d37c7 100644 --- a/module/zfs/arc.c +++ b/module/zfs/arc.c @@ -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)) { @@ -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. |