summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorWaiman Long <longman@redhat.com>2018-05-24 09:26:38 -0400
committerThomas Gleixner <tglx@linutronix.de>2018-06-20 11:29:23 +0200
commit03eeafdd9ab06a770d42c2b264d50dff7e2f4eee (patch)
tree3cccf50416229788dce5958a85cc1eced775d142 /kernel
parent7ea959c45769612aa92557fb6464679f5fec7d9e (diff)
downloadlwn-03eeafdd9ab06a770d42c2b264d50dff7e2f4eee.tar.gz
lwn-03eeafdd9ab06a770d42c2b264d50dff7e2f4eee.zip
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: 5149cbac4235 ("locking/rwsem: Add DEBUG_RWSEMS to look for lock/unlock mismatches") Signed-off-by: Waiman Long <longman@redhat.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org> Tested-by: Gavin Schenk <g.schenk@eckelmann.de> Cc: Davidlohr Bueso <dave@stgolabs.net> Cc: Dan Williams <dan.j.williams@intel.com> Cc: Arnd Bergmann <arnd@arndb.de> Cc: linux-nfs@vger.kernel.org Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/1527168398-4291-1-git-send-email-longman@redhat.com
Diffstat (limited to 'kernel')
-rw-r--r--kernel/locking/rwsem.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/kernel/locking/rwsem.c b/kernel/locking/rwsem.c
index bc1e507be9ff..776308d2fa9e 100644
--- a/kernel/locking/rwsem.c
+++ b/kernel/locking/rwsem.c
@@ -181,6 +181,7 @@ void down_read_non_owner(struct rw_semaphore *sem)
might_sleep();
__down_read(sem);
+ rwsem_set_reader_owned(sem);
}
EXPORT_SYMBOL(down_read_non_owner);