lkml.org 
[lkml]   [2008]   [Sep]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[mmotm] build error fix of "fix a race condition of oops_in_progress"
Hi Andrew,

I love CONFIG_DEBUG_MUTEXES.
Could you please pick up following patch?


=====================================
From: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>

Patch against: mmotm 09/13
Patch name: fix-a-race-condtion-of-oops_in_progress-fix2.patch
Applied after: fix-a-race-condtion-of-oops_in_progress-fix.patch


if CONFIG_DEBUG_MUTEXES=y, mutex.c makes following build error.
because oops_in_progress was changed from int to atomic_t.

------------------------------------------------------------------
CC kernel/mutex.o
kernel/mutex.c: In function '__mutex_lock_common':
kernel/mutex.c:135: error: wrong type argument to unary exclamation mark
kernel/mutex.c:135: error: wrong type argument to unary exclamation mark
kernel/mutex.c:183: error: wrong type argument to unary exclamation mark
kernel/mutex.c:183: error: wrong type argument to unary exclamation mark
kernel/mutex.c: In function '__mutex_unlock_common_slowpath':
kernel/mutex.c:240: error: wrong type argument to unary exclamation mark
kernel/mutex.c:240: error: wrong type argument to unary exclamation mark
kernel/mutex.c: In function '__mutex_trylock_slowpath':
kernel/mutex.c:351: error: wrong type argument to unary exclamation mark
kernel/mutex.c:351: error: wrong type argument to unary exclamation mark
make[1]: *** [kernel/mutex.o] Error 1
make: *** [kernel] Error 2
---------------------------------------------------------------


Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
CC: Huang Ying <ying.huang@intel.com>
CC: Andrew Morton <akpm@linux-foundation.org>

---
include/linux/debug_locks.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Index: b/include/linux/debug_locks.h
===================================================================
--- a/include/linux/debug_locks.h
+++ b/include/linux/debug_locks.h
@@ -17,7 +17,7 @@ extern int debug_locks_off(void);
({ \
int __ret = 0; \
\
- if (!oops_in_progress && unlikely(c)) { \
+ if (!atomic_read(&oops_in_progress) && unlikely(c)) { \
if (debug_locks_off() && !debug_locks_silent) \
WARN_ON(1); \
__ret = 1; \



\
 
 \ /
  Last update: 2008-09-15 07:49    [W:0.024 / U:0.436 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site