lockdep, rwsem: fix down_write_nest_lock() if !CONFIG_DEBUG_LOCK_ALLOC
authorJiri Kosina <jkosina@suse.cz>
Tue, 15 Jan 2013 19:12:37 +0000 (20:12 +0100)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 16 Jan 2013 20:13:20 +0000 (12:13 -0800)
Commit 1b963c81b145 ("lockdep, rwsem: provide down_write_nest_lock()")
contains a bug in a codepath when CONFIG_DEBUG_LOCK_ALLOC is disabled,
which causes down_read() to be called instead of down_write() by mistake
on such configurations.  Fix that.

Reported-and-tested-by: Andrew Clayton <andrew@digital-domain.net>
Reported-and-tested-by: Zlatko Calusic <zlatko.calusic@iskon.hr>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Reviewed-by: Rik van Riel <riel@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
include/linux/rwsem.h

index 413cc11e414a7af34bd0946dac18f29021e7ecbd..8da67d625e13fc888413847da4e2a7ae560b3d86 100644 (file)
@@ -135,7 +135,7 @@ do {                                                                \
 
 #else
 # define down_read_nested(sem, subclass)               down_read(sem)
-# define down_write_nest_lock(sem, nest_lock)  down_read(sem)
+# define down_write_nest_lock(sem, nest_lock)  down_write(sem)
 # define down_write_nested(sem, subclass)      down_write(sem)
 #endif