aboutsummaryrefslogtreecommitdiffstats
path: root/include/sys/zfs_context.h
diff options
context:
space:
mode:
authorlidongyang <[email protected]>2019-02-23 04:48:37 +1100
committerBrian Behlendorf <[email protected]>2019-02-22 09:48:37 -0800
commit8d9e51c084805237a36420e6cdcd8e2e9801a7cf (patch)
tree250c85d7ccbcf69cbb09b0ce1cddc2c188be4a68 /include/sys/zfs_context.h
parentf8bb2a7e0c889d6c5cf7655d698869b3a32c2bb0 (diff)
Fix dnode_hold_impl() soft lockup
Soft lockups could happen when multiple threads trying to get zrl on the same dnode handle in order to allocate and initialize the dnode marked as DN_SLOT_ALLOCATED. Don't loop from beginning when we can't get zrl, otherwise we would increase the zrl refcount and nobody can actually lock it. Reviewed by: Tom Caputi <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Li Dongyang <[email protected]> Closes #8433
Diffstat (limited to 'include/sys/zfs_context.h')
-rw-r--r--include/sys/zfs_context.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/sys/zfs_context.h b/include/sys/zfs_context.h
index 11a32bb31..260b8a458 100644
--- a/include/sys/zfs_context.h
+++ b/include/sys/zfs_context.h
@@ -236,6 +236,7 @@ extern kthread_t *zk_thread_create(void (*func)(void *), void *arg,
#define kpreempt_disable() ((void)0)
#define kpreempt_enable() ((void)0)
+#define cond_resched() sched_yield()
/*
* Mutexes