diff options
author | delphij <delphij@FreeBSD.org> | 2014-01-18 01:45:39 +0000 |
---|---|---|
committer | delphij <delphij@FreeBSD.org> | 2014-01-18 01:45:39 +0000 |
commit | 4b064bf9acc3d91a2019c8df378d816ff4f147d6 (patch) | |
tree | 5617cba07d0ee04645bf4e75c7085b6219021498 /sys/cddl | |
parent | f2d92b6efc726472fe466650a3d4afcee1f148bb (diff) | |
download | FreeBSD-src-4b064bf9acc3d91a2019c8df378d816ff4f147d6.zip FreeBSD-src-4b064bf9acc3d91a2019c8df378d816ff4f147d6.tar.gz |
MFV r260834:
Fix memory leak of compressed buffers in l2arc_write_done (Illumos
#3995).
Diffstat (limited to 'sys/cddl')
-rw-r--r-- | sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c index 6b6370d..0552905 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c @@ -21,7 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2013 by Delphix. All rights reserved. - * Copyright (c) 2013 by Saso Kiselkov. All rights reserved. + * Copyright (c) 2014 by Saso Kiselkov. All rights reserved. * Copyright 2013 Nexenta Systems, Inc. All rights reserved. */ @@ -4597,6 +4597,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)) { @@ -4609,14 +4616,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. |