lkml.org 
[lkml]   [2006]   [Dec]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[patch] lockdep: fix possible race while disabling lock-debugging, restore fix

* Jarek Poplawski <jarkao2@o2.pl> wrote:

> ...
> > @@ -1212,7 +1244,8 @@ register_lock_class(struct lockdep_map *
> > hash_head = classhashentry(key);
> >
> > raw_local_irq_save(flags);
> > - __raw_spin_lock(&hash_lock);
> > + if (!graph_lock())
>
> ! raw_local_irq_restore(flags);
>
> > + return NULL;

yeah. Fix below.

Ingo

Subject: [patch] lockdep: fix possible race while disabling lock-debugging, restore fix
From: Ingo Molnar <mingo@elte.hu>

restore flags in failure branch, pointed out by Jarek Poplawski.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
kernel/lockdep.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

Index: linux/kernel/lockdep.c
===================================================================
--- linux.orig/kernel/lockdep.c
+++ linux/kernel/lockdep.c
@@ -1244,8 +1244,10 @@ register_lock_class(struct lockdep_map *
hash_head = classhashentry(key);

raw_local_irq_save(flags);
- if (!graph_lock())
+ if (!graph_lock()) {
+ raw_local_irq_restore(flags);
return NULL;
+ }
/*
* We have to do the hash-walk again, to avoid races
* with another CPU:
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2006-12-11 08:33    [W:0.568 / U:0.124 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site