mirror of
https://github.com/torvalds/linux.git
synced 2026-10-07 05:31:08 -04:00
locking/lockdep: Make concurrent lockdep_reset_lock() calls safe
Since zap_class() removes items from the all_lock_classes list and the classhash_table, protect all zap_class() calls against concurrent data structure modifications with the graph lock. Signed-off-by: Bart Van Assche <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Cc: Johannes Berg <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Sasha Levin <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Waiman Long <[email protected]> Cc: [email protected] Cc: [email protected] Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
This commit is contained in:
1 parent
a66b6922dc
commit
786fa29e9c
1 file changed
+4
-1
@@ -4122,6 +4122,9 @@ void lockdep_reset(void)
|
||||
raw_local_irq_restore(flags);
|
||||
}
|
||||
|
||||
/*
|
||||
* Remove all references to a lock class. The caller must hold the graph lock.
|
||||
*/
|
||||
static void zap_class(struct lock_class *class)
|
||||
{
|
||||
int i;
|
||||
@@ -4229,6 +4232,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:
|
||||
@@ -4245,7 +4249,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()) {
|
||||
/*
|
||||
|
||||
Reference in new issue
Block a user