summaryrefslogtreecommitdiffstats
path: root/sys/cddl/contrib
diff options
context:
space:
mode:
authoravg <avg@FreeBSD.org>2014-02-17 18:16:25 +0000
committeravg <avg@FreeBSD.org>2014-02-17 18:16:25 +0000
commitb0a412937022eafe8c2d5bbc56abe56fd7b1b098 (patch)
tree6926671f6567fad3f2fe1eaaa5204f17d6a53dff /sys/cddl/contrib
parentc448604d7f2d9873cc7634751fa6f6476230489e (diff)
downloadFreeBSD-src-b0a412937022eafe8c2d5bbc56abe56fd7b1b098.zip
FreeBSD-src-b0a412937022eafe8c2d5bbc56abe56fd7b1b098.tar.gz
MFC r260835: MFV r260834: Fix memory leak of compressed buffers in l2arc_write_done
Diffstat (limited to 'sys/cddl/contrib')
-rw-r--r--sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c17
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 a4fbf04..cb0d63c 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.
*/
@@ -4593,6 +4593,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)) {
@@ -4605,14 +4612,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.
OpenPOWER on IntegriCloud