Project

General

Profile

Bug #6220

memleak in l2arc on debug build

Added by Arne Jansen about 4 years ago. Updated about 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
zfs - Zettabyte File System
Start date:
2015-09-11
Due date:
% Done:

100%

Estimated time:
Difficulty:
Bite-size
Tags:
needs-triage

Description

5408 introduced a memleak in l2arc, namely the member b_thawed gets leaked when an arc_hdr is realloced from full to l2only. The leaked is fixed by:

--- a/usr/src/uts/common/fs/zfs/arc.c
+++ b/usr/src/uts/common/fs/zfs/arc.c
@@ -1309,6 +1309,12 @@ arc_hdr_realloc(arc_buf_hdr_t *hdr, kmem_cache_t *old, km
                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;
        }
        /*

History

#1

Updated by Electric Monk about 4 years ago

  • Status changed from In Progress to Closed

git commit c546f36aa898d913ff77674fb5ff97f15b2e08b4

commit  c546f36aa898d913ff77674fb5ff97f15b2e08b4
Author: Arne Jansen <sensille@gmx.net>
Date:   2015-09-14T16:43:22.000Z

    6220 memleak in l2arc on debug build
    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>

Also available in: Atom PDF