Add fix-dbuf_dirty_record_t branch

This commit is contained in:
Brian Behlendorf 2008-11-20 12:52:09 -08:00
parent 34dc7c2f25
commit 4e9ae1370a
5 changed files with 17 additions and 0 deletions

1
.topdeps Normal file
View File

@ -0,0 +1 @@
master

8
.topmsg Normal file
View File

@ -0,0 +1,8 @@
From: Brian Behlendorf <behlendorf1@llnl.gov>
Subject: [PATCH] fix dbuf_dirty_record_t
Fix two leaks with dbuf_dirty_record_t
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
---

View File

@ -1929,6 +1929,10 @@ dbuf_sync_leaf(dbuf_dirty_record_t *dr, dmu_tx_t *tx)
drp = &(*drp)->dr_next; drp = &(*drp)->dr_next;
ASSERT(dr->dr_next == NULL); ASSERT(dr->dr_next == NULL);
*drp = dr->dr_next; *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)); kmem_free(dr, sizeof (dbuf_dirty_record_t));
ASSERT(db->db_dirtycnt > 0); ASSERT(db->db_dirtycnt > 0);
db->db_dirtycnt -= 1; db->db_dirtycnt -= 1;

View File

@ -429,6 +429,8 @@ dnode_undirty_dbufs(list_t *list)
} else { } else {
mutex_exit(&db->db_mtx); mutex_exit(&db->db_mtx);
dnode_undirty_dbufs(&dr->dt.di.dr_children); dnode_undirty_dbufs(&dr->dt.di.dr_children);
mutex_destroy(&dr->dt.di.dr_mtx);
list_destroy(&dr->dt.di.dr_children);
} }
kmem_free(dr, sizeof (dbuf_dirty_record_t)); kmem_free(dr, sizeof (dbuf_dirty_record_t));
dbuf_rele(db, (void *)(uintptr_t)txg); dbuf_rele(db, (void *)(uintptr_t)txg);

View File

@ -1296,6 +1296,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) if (sense == ZFS_CASE_INSENSITIVE || sense == ZFS_CASE_MIXED)
zfsvfs.z_norm |= U8_TEXTPREP_TOUPPER; 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); mutex_init(&zfsvfs.z_znodes_lock, NULL, MUTEX_DEFAULT, NULL);
list_create(&zfsvfs.z_all_znodes, sizeof (znode_t), list_create(&zfsvfs.z_all_znodes, sizeof (znode_t),
offsetof(znode_t, z_link_node)); offsetof(znode_t, z_link_node));