]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit1938deb82475a370106bcab459f3a008579fc542
tree3cccf50416229788dce5958a85cc1eced775d142
parentb7a49f4160cf0ea8c984f857d4258db293f6c66a
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: b3251c86c235 ("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