locking/rwsem: Fix up_read_non_owner() warning with DEBUG_RWSEMS
authorWaiman Long <longman@redhat.com>
Thu, 24 May 2018 13:26:38 +0000 (09:26 -0400)
committerThomas Gleixner <tglx@linutronix.de>
Wed, 20 Jun 2018 09:29:23 +0000 (11:29 +0200)
commit03eeafdd9ab06a770d42c2b264d50dff7e2f4eee
tree3cccf50416229788dce5958a85cc1eced775d142
parent7ea959c45769612aa92557fb6464679f5fec7d9e
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
kernel/locking/rwsem.c