Skip to content

Commit e65b9ad

Browse files
Jiri Kosinatorvalds
authored andcommitted
lockdep, rwsem: fix down_write_nest_lock() if !CONFIG_DEBUG_LOCK_ALLOC
Commit 1b963c8 ("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>
1 parent 36e7a96 commit e65b9ad

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/linux/rwsem.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ do { \
135135

136136
#else
137137
# define down_read_nested(sem, subclass) down_read(sem)
138-
# define down_write_nest_lock(sem, nest_lock) down_read(sem)
138+
# define down_write_nest_lock(sem, nest_lock) down_write(sem)
139139
# define down_write_nested(sem, subclass) down_write(sem)
140140
#endif
141141

0 commit comments

Comments
 (0)