summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJorgen Lundman <[email protected]>2015-04-02 00:49:14 +1100
committerBrian Behlendorf <[email protected]>2015-04-28 16:23:38 -0700
commit58c4aa00c65e09f254de0b939b2c1aa720c204a1 (patch)
treeadd79d708eb8b3dd10f062d8c9231fd2d249d21e
parentca227e54a89e0797ca99063a326f01633267a44a (diff)
Illumos 4975 - missing mutex_destroy() calls in zfs
4975 missing mutex_destroy() calls in zfs Author: Jorgen Lundman <[email protected]> Reviewed by: Matthew Ahrens <[email protected]> Reviewed by: George Wilson <[email protected]> Reviewed by: Rich Lowe <[email protected]> Reviewed by: Seth Nimbosa <[email protected]> Reviewed by: Dan McDonald <[email protected]> Reviewed by: Don Brady <[email protected]> Approved by: Dan McDonald <[email protected]> References: https://www.illumos.org/issues/4975 https://github.com/illumos/illumos-gate/commit/d2b3cbb Ported-by: Chris Dunlop <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]>
-rw-r--r--module/zfs/dbuf.c6
-rw-r--r--module/zfs/dnode.c5
-rw-r--r--module/zfs/dnode_sync.c3
-rw-r--r--module/zfs/dsl_dataset.c3
-rw-r--r--module/zfs/sa.c4
5 files changed, 21 insertions, 0 deletions
diff --git a/module/zfs/dbuf.c b/module/zfs/dbuf.c
index ed6a8fd2a..f5327a34a 100644
--- a/module/zfs/dbuf.c
+++ b/module/zfs/dbuf.c
@@ -1423,6 +1423,12 @@ dbuf_undirty(dmu_buf_impl_t *db, dmu_tx_t *tx)
if (dr->dt.dl.dr_data != db->db_buf)
VERIFY(arc_buf_remove_ref(dr->dt.dl.dr_data, db));
}
+
+ if (db->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);
diff --git a/module/zfs/dnode.c b/module/zfs/dnode.c
index ef74621a0..815696f70 100644
--- a/module/zfs/dnode.c
+++ b/module/zfs/dnode.c
@@ -1079,6 +1079,11 @@ dnode_hold_impl(objset_t *os, uint64_t object, int flag,
}
if ((winner = dmu_buf_set_user(&db->db, children_dnodes, NULL,
dnode_buf_pageout))) {
+
+ for (i = 0; i < epb; i++) {
+ zrl_destroy(&dnh[i].dnh_zrlock);
+ }
+
kmem_free(children_dnodes, sizeof (dnode_children_t) +
(epb - 1) * sizeof (dnode_handle_t));
children_dnodes = winner;
diff --git a/module/zfs/dnode_sync.c b/module/zfs/dnode_sync.c
index 1825e9835..9779c51ef 100644
--- a/module/zfs/dnode_sync.c
+++ b/module/zfs/dnode_sync.c
@@ -491,6 +491,9 @@ dnode_undirty_dbufs(list_t *list)
ASSERT(db->db_blkid == DMU_BONUS_BLKID ||
dr->dt.dl.dr_data == db->db_buf);
dbuf_unoverride(dr);
+ } else {
+ mutex_destroy(&dr->dt.di.dr_mtx);
+ list_destroy(&dr->dt.di.dr_children);
}
kmem_free(dr, sizeof (dbuf_dirty_record_t));
dbuf_rele_and_unlock(db, (void *)(uintptr_t)txg);
diff --git a/module/zfs/dsl_dataset.c b/module/zfs/dsl_dataset.c
index 34c473006..5f2e205d9 100644
--- a/module/zfs/dsl_dataset.c
+++ b/module/zfs/dsl_dataset.c
@@ -267,6 +267,7 @@ dsl_dataset_evict(dmu_buf_t *db, void *dsv)
mutex_destroy(&ds->ds_lock);
mutex_destroy(&ds->ds_opening_lock);
+ mutex_destroy(&ds->ds_sendstream_lock);
refcount_destroy(&ds->ds_longholds);
kmem_free(ds, sizeof (dsl_dataset_t));
@@ -396,6 +397,7 @@ dsl_dataset_hold_obj(dsl_pool_t *dp, uint64_t dsobj, void *tag,
if (err != 0) {
mutex_destroy(&ds->ds_lock);
mutex_destroy(&ds->ds_opening_lock);
+ mutex_destroy(&ds->ds_sendstream_lock);
refcount_destroy(&ds->ds_longholds);
bplist_destroy(&ds->ds_pending_deadlist);
dsl_deadlist_close(&ds->ds_deadlist);
@@ -452,6 +454,7 @@ dsl_dataset_hold_obj(dsl_pool_t *dp, uint64_t dsobj, void *tag,
dsl_dir_rele(ds->ds_dir, ds);
mutex_destroy(&ds->ds_lock);
mutex_destroy(&ds->ds_opening_lock);
+ mutex_destroy(&ds->ds_sendstream_lock);
refcount_destroy(&ds->ds_longholds);
kmem_free(ds, sizeof (dsl_dataset_t));
if (err != 0) {
diff --git a/module/zfs/sa.c b/module/zfs/sa.c
index 9063d1dae..7b6c7177d 100644
--- a/module/zfs/sa.c
+++ b/module/zfs/sa.c
@@ -1112,6 +1112,9 @@ fail:
if (sa->sa_user_table)
kmem_free(sa->sa_user_table, sa->sa_user_table_sz);
mutex_exit(&sa->sa_lock);
+ avl_destroy(&sa->sa_layout_hash_tree);
+ avl_destroy(&sa->sa_layout_num_tree);
+ mutex_destroy(&sa->sa_lock);
kmem_free(sa, sizeof (sa_os_t));
return ((error == ECKSUM) ? EIO : error);
}
@@ -1148,6 +1151,7 @@ sa_tear_down(objset_t *os)
avl_destroy(&sa->sa_layout_hash_tree);
avl_destroy(&sa->sa_layout_num_tree);
+ mutex_destroy(&sa->sa_lock);
kmem_free(sa, sizeof (sa_os_t));
os->os_sa = NULL;