aboutsummaryrefslogtreecommitdiffstats
path: root/module/zfs/dmu_objset.c
diff options
context:
space:
mode:
authorArne Jansen <[email protected]>2015-07-02 17:58:17 +0200
committerBrian Behlendorf <[email protected]>2015-07-06 09:31:35 -0700
commit5e8cd5d17f21200beb5f6fae8e8be64c0491195d (patch)
treee714db2ad0eeb07ff449c433a4516dacefe41cc6 /module/zfs/dmu_objset.c
parent71e2fe41be982076f14fe5d39bcf5f7051a937f0 (diff)
Illumos 5981 - Deadlock in dmu_objset_find_dp
5981 Deadlock in dmu_objset_find_dp Reviewed by: Matthew Ahrens <[email protected]> Reviewed by: Dan McDonald <[email protected]> Approved by: Robert Mustacchi <[email protected]> References: https://www.illumos.org/issues/5981 https://github.com/illumos/illumos-gate/commit/1d3f896 Ported-by: kernelOfTruth [email protected] Signed-off-by: Brian Behlendorf <[email protected]> Closes #3553
Diffstat (limited to 'module/zfs/dmu_objset.c')
-rw-r--r--module/zfs/dmu_objset.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/module/zfs/dmu_objset.c b/module/zfs/dmu_objset.c
index bc1aa1286..823a15677 100644
--- a/module/zfs/dmu_objset.c
+++ b/module/zfs/dmu_objset.c
@@ -1784,7 +1784,15 @@ dmu_objset_find_dp_cb(void *arg)
dmu_objset_find_ctx_t *dcp = arg;
dsl_pool_t *dp = dcp->dc_dp;
- dsl_pool_config_enter(dp, FTAG);
+ /*
+ * We need to get a pool_config_lock here, as there are several
+ * asssert(pool_config_held) down the stack. Getting a lock via
+ * dsl_pool_config_enter is risky, as it might be stalled by a
+ * pending writer. This would deadlock, as the write lock can
+ * only be granted when our parent thread gives up the lock.
+ * The _prio interface gives us priority over a pending writer.
+ */
+ dsl_pool_config_enter_prio(dp, FTAG);
dmu_objset_find_dp_impl(dcp);