Skip to content

Commit 855cf1e

Browse files
committed
Merge tag 'locking-urgent-2020-11-22' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull locking fix from Thomas Gleixner: "A single fix for lockdep which makes the recursion protection cover graph lock/unlock" * tag 'locking-urgent-2020-11-22' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: lockdep: Put graph lock/unlock under lock_recursion protection
2 parents 68d3fa2 + 43be438 commit 855cf1e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

kernel/locking/lockdep.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,19 +108,21 @@ static inline void lockdep_lock(void)
108108
{
109109
DEBUG_LOCKS_WARN_ON(!irqs_disabled());
110110

111+
__this_cpu_inc(lockdep_recursion);
111112
arch_spin_lock(&__lock);
112113
__owner = current;
113-
__this_cpu_inc(lockdep_recursion);
114114
}
115115

116116
static inline void lockdep_unlock(void)
117117
{
118+
DEBUG_LOCKS_WARN_ON(!irqs_disabled());
119+
118120
if (debug_locks && DEBUG_LOCKS_WARN_ON(__owner != current))
119121
return;
120122

121-
__this_cpu_dec(lockdep_recursion);
122123
__owner = NULL;
123124
arch_spin_unlock(&__lock);
125+
__this_cpu_dec(lockdep_recursion);
124126
}
125127

126128
static inline bool lockdep_assert_locked(void)

0 commit comments

Comments
 (0)