[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <tip-03eeafdd9ab06a770d42c2b264d50dff7e2f4eee@git.kernel.org>
Date: Wed, 20 Jun 2018 02:33:51 -0700
From: tip-bot for Waiman Long <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: dave@...olabs.net, arnd@...db.de, linux-kernel@...r.kernel.org,
g.schenk@...elmann.de, peterz@...radead.org, tglx@...utronix.de,
longman@...hat.com, mingo@...nel.org, hpa@...or.com,
dan.j.williams@...el.com
Subject: [tip:locking/urgent] locking/rwsem: Fix up_read_non_owner() warning
with DEBUG_RWSEMS
Commit-ID: 03eeafdd9ab06a770d42c2b264d50dff7e2f4eee
Gitweb: https://git.kernel.org/tip/03eeafdd9ab06a770d42c2b264d50dff7e2f4eee
Author: Waiman Long <longman@...hat.com>
AuthorDate: Thu, 24 May 2018 09:26:38 -0400
Committer: Thomas Gleixner <tglx@...utronix.de>
CommitDate: Wed, 20 Jun 2018 11:29:23 +0200
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@...hat.com>
Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
Acked-by: Peter Zijlstra (Intel) <peterz@...radead.org>
Tested-by: Gavin Schenk <g.schenk@...elmann.de>
Cc: Davidlohr Bueso <dave@...olabs.net>
Cc: Dan Williams <dan.j.williams@...el.com>
Cc: Arnd Bergmann <arnd@...db.de>
Cc: linux-nfs@...r.kernel.org
Cc: stable@...r.kernel.org
Link: https://lkml.kernel.org/r/1527168398-4291-1-git-send-email-longman@redhat.com
---
kernel/locking/rwsem.c | 1 +
1 file changed, 1 insertion(+)
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);
Powered by blists - more mailing lists