lkml.org 
[lkml]   [2018]   [Nov]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 15/27] locking/lockdep: Make concurrent lockdep_reset_lock() calls safe
Date
Since zap_class() removes items from the all_lock_classes list and the
classhash_table, protect all zap_class() calls with the graph lock.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
kernel/locking/lockdep.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c
index 83ffcc7f1ced..ab6abe52e974 100644
--- a/kernel/locking/lockdep.c
+++ b/kernel/locking/lockdep.c
@@ -4227,6 +4227,7 @@ void lockdep_reset_lock(struct lockdep_map *lock)
int j, locked;

raw_local_irq_save(flags);
+ locked = graph_lock();

/*
* Remove all classes this lock might have:
@@ -4243,7 +4244,6 @@ void lockdep_reset_lock(struct lockdep_map *lock)
* Debug check: in the end all mapped classes should
* be gone.
*/
- locked = graph_lock();
if (unlikely(lock_class_cache_is_registered(lock))) {
if (debug_locks_off_graph_unlock()) {
/*
--
2.20.0.rc0.387.gc7a69e6b6c-goog
\
 
 \ /
  Last update: 2018-11-29 00:46    [W:0.182 / U:0.276 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site