Skip to content

Commit 03eeafd

Browse files
Waiman-LongKAGA-KOKO
authored andcommitted
locking/rwsem: Fix up_read_non_owner() warning with DEBUG_RWSEMS
It was found that the use of up_read_non_owner() in NFS was causing the following warning when DEBUG_RWSEMS was configured. DEBUG_LOCKS_WARN_ON(sem->owner != ((struct task_struct *)(1UL << 0))) Looking into the rwsem.c file, it was discovered that the corresponding down_read_non_owner() function was not setting the owner field properly. This is fixed now, and the warning should be gone. Fixes: 5149cba ("locking/rwsem: Add DEBUG_RWSEMS to look for lock/unlock mismatches") Signed-off-by: Waiman Long <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Acked-by: Peter Zijlstra (Intel) <[email protected]> Tested-by: Gavin Schenk <[email protected]> Cc: Davidlohr Bueso <[email protected]> Cc: Dan Williams <[email protected]> Cc: Arnd Bergmann <[email protected]> Cc: [email protected] Cc: [email protected] Link: https://lkml.kernel.org/r/[email protected]
1 parent 7ea959c commit 03eeafd

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

kernel/locking/rwsem.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ void down_read_non_owner(struct rw_semaphore *sem)
181181
might_sleep();
182182

183183
__down_read(sem);
184+
rwsem_set_reader_owned(sem);
184185
}
185186

186187
EXPORT_SYMBOL(down_read_non_owner);

0 commit comments

Comments
 (0)