[lkml]   [2018]   [Jul]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH 4.17 126/220] locking/rwsem: Fix up_read_non_owner() warning with DEBUG_RWSEMS
4.17-stable review patch.  If anyone has any objections, please let me know.


From: Waiman Long <>

commit 03eeafdd9ab06a770d42c2b264d50dff7e2f4eee upstream.

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: 5149cbac4235 ("locking/rwsem: Add DEBUG_RWSEMS to look for lock/unlock mismatches")
Signed-off-by: Waiman Long <>
Signed-off-by: Thomas Gleixner <>
Acked-by: Peter Zijlstra (Intel) <>
Tested-by: Gavin Schenk <>
Cc: Davidlohr Bueso <>
Cc: Dan Williams <>
Cc: Arnd Bergmann <>
Signed-off-by: Greg Kroah-Hartman <>

kernel/locking/rwsem.c | 1 +
1 file changed, 1 insertion(+)

--- a/kernel/locking/rwsem.c
+++ b/kernel/locking/rwsem.c
@@ -181,6 +181,7 @@ void down_read_non_owner(struct rw_semap

+ rwsem_set_reader_owned(sem);


 \ /
  Last update: 2018-07-01 19:07    [W:0.623 / U:6.396 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site