MFV r287817: 6220 memleak in l2arc on debug build

c546f36aa8
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>
This commit is contained in:
Andriy Gapon 2015-09-21 12:23:01 +00:00
commit e88445a48b

View File

@ -1485,6 +1485,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;
}
/*