From 753972fccf7d3d5c9406edbd5281950681e0f606 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Thu, 26 Aug 2010 10:19:04 -0700 Subject: Fix dbuf_dirty_record_t leaks Fix two leaks with dbuf_dirty_record_t Signed-off-by: Brian Behlendorf --- module/zfs/dbuf.c | 4 ++++ module/zfs/zfs_znode.c | 2 ++ 2 files changed, 6 insertions(+) (limited to 'module/zfs') diff --git a/module/zfs/dbuf.c b/module/zfs/dbuf.c index 7b66fcea4..55326c498 100644 --- a/module/zfs/dbuf.c +++ b/module/zfs/dbuf.c @@ -2319,6 +2319,10 @@ dbuf_sync_leaf(dbuf_dirty_record_t *dr, dmu_tx_t *tx) ASSERT(dr->dr_next == NULL); ASSERT(dr->dr_dbuf == db); *drp = dr->dr_next; + if (dr->dr_dbuf->db_level != 0) { + mutex_destroy(&dr->dt.di.dr_mtx); + list_destroy(&dr->dt.di.dr_children); + } kmem_free(dr, sizeof (dbuf_dirty_record_t)); ASSERT(db->db_dirtycnt > 0); db->db_dirtycnt -= 1; diff --git a/module/zfs/zfs_znode.c b/module/zfs/zfs_znode.c index 018f12d96..79d8d2e7e 100644 --- a/module/zfs/zfs_znode.c +++ b/module/zfs/zfs_znode.c @@ -1856,6 +1856,8 @@ zfs_create_fs(objset_t *os, cred_t *cr, nvlist_t *zplprops, dmu_tx_t *tx) if (sense == ZFS_CASE_INSENSITIVE || sense == ZFS_CASE_MIXED) zfsvfs.z_norm |= U8_TEXTPREP_TOUPPER; + /* XXX - This must be destroyed but I'm not quite sure yet so + * I'm just annotating that fact when it's an issue. -Brian */ mutex_init(&zfsvfs.z_znodes_lock, NULL, MUTEX_DEFAULT, NULL); list_create(&zfsvfs.z_all_znodes, sizeof (znode_t), offsetof(znode_t, z_link_node)); -- cgit v1.2.3