summaryrefslogtreecommitdiffstats
path: root/sys/cddl
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2015-10-03 11:43:54 +0000
committermav <mav@FreeBSD.org>2015-10-03 11:43:54 +0000
commitcc1f6f382064e208de941a6c4dbb9b689bdb918e (patch)
treeac52d1068d265768ffe84c0b86f740074028ba32 /sys/cddl
parent3a9f042f34f2bff2800169c77084cb459338768f (diff)
downloadFreeBSD-src-cc1f6f382064e208de941a6c4dbb9b689bdb918e.zip
FreeBSD-src-cc1f6f382064e208de941a6c4dbb9b689bdb918e.tar.gz
MFC r288064 (by avg): 6220 memleak in l2arc on debug build
illumos/illumos-gate/commit/c546f36aa898d913ff77674fb5ff97f15b2e08b4 https://www.illumos.org/issues/6220 5408 introduced a memleak in l2arc, namely the member b_thawed gets leaked when an arc_hdr is realloced from full to l2only. Reviewed by: Saso Kiselkov <saso.kiselkov@nexenta.com> Reviewed by: Simon Klinkert <simon.klinkert@gmail.com> Reviewed by: George Wilson <george@delphix.com> Approved by: Robert Mustacchi <rm@joyent.com> Author: Arne Jansen <sensille@gmx.net>
Diffstat (limited to 'sys/cddl')
-rw-r--r--sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c7
1 files changed, 7 insertions, 0 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 ec87c65..b053993 100644
--- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
+++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
@@ -1488,6 +1488,13 @@ arc_hdr_realloc(arc_buf_hdr_t *hdr, kmem_cache_t *old, kmem_cache_t *new)
VERIFY(!HDR_L2_WRITING(hdr));
VERIFY3P(hdr->b_l1hdr.b_tmp_cdata, ==, NULL);
+#ifdef ZFS_DEBUG
+ if (hdr->b_l1hdr.b_thawed != NULL) {
+ kmem_free(hdr->b_l1hdr.b_thawed, 1);
+ hdr->b_l1hdr.b_thawed = NULL;
+ }
+#endif
+
nhdr->b_flags &= ~ARC_FLAG_HAS_L1HDR;
}
/*
OpenPOWER on IntegriCloud