]> git.proxmox.com Git - mirror_zfs.git/commitdiff
Mutex leak in dsl_dataset_hold_obj()
authorJorgen Lundman <lundman@lundman.net>
Tue, 19 Mar 2019 03:34:30 +0000 (12:34 +0900)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Thu, 21 Mar 2019 17:36:58 +0000 (10:36 -0700)
In addition to dsl_dataset_evict_async() releasing a hold, there is
an error case in dsl_dataset_hold_obj() which had missed 4 additional
release calls.  This was introduced in a1d477c24.

openzfsonosx-commit: https://github.com/openzfsonosx/zfs/commit/63ff7f1c

Authored by: Jorgen Lundman <lundman@lundman.net>
Reviewed-by: Olaf Faaland <faaland1@llnl.gov>
Reviewed by: Brian Behlendorf <behlendorf1@llnl.gov>
Ported-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #8517

module/zfs/dsl_dataset.c

index 086750fed9355f9ce7b34d5cf6c69bbcfde0cdcf..966c2cc93d13093baefcef469f0ad3fc033825be 100644 (file)
@@ -650,10 +650,14 @@ dsl_dataset_hold_obj(dsl_pool_t *dp, uint64_t dsobj, void *tag,
                        if (ds->ds_prev)
                                dsl_dataset_rele(ds->ds_prev, ds);
                        dsl_dir_rele(ds->ds_dir, ds);
+                       list_destroy(&ds->ds_prop_cbs);
+                       list_destroy(&ds->ds_sendstreams);
                        mutex_destroy(&ds->ds_lock);
                        mutex_destroy(&ds->ds_opening_lock);
                        mutex_destroy(&ds->ds_sendstream_lock);
+                       mutex_destroy(&ds->ds_remap_deadlist_lock);
                        zfs_refcount_destroy(&ds->ds_longholds);
+                       rrw_destroy(&ds->ds_bp_rwlock);
                        kmem_free(ds, sizeof (dsl_dataset_t));
                        if (err != 0) {
                                dmu_buf_rele(dbuf, tag);