From: tip-bot for Waiman Long <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: dave@stgolabs.net, arnd@arndb.de, linux-kernel@vger.kernel.org,
g.schenk@eckelmann.de, peterz@infradead.org, tglx@linutronix.de,
longman@redhat.com, mingo@kernel.org, hpa@zytor.com,
dan.j.williams@intel.com
Subject: [tip:locking/urgent] locking/rwsem: Fix up_read_non_owner() warning with DEBUG_RWSEMS
Date: Wed, 20 Jun 2018 02:33:51 -0700 [thread overview]
Message-ID: <tip-03eeafdd9ab06a770d42c2b264d50dff7e2f4eee@git.kernel.org> (raw)
In-Reply-To: <1527168398-4291-1-git-send-email-longman@redhat.com>
Commit-ID: 03eeafdd9ab06a770d42c2b264d50dff7e2f4eee
Gitweb: https://git.kernel.org/tip/03eeafdd9ab06a770d42c2b264d50dff7e2f4eee
Author: Waiman Long <longman@redhat.com>
AuthorDate: Thu, 24 May 2018 09:26:38 -0400
Committer: Thomas Gleixner <tglx@linutronix.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@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 | 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);
prev parent reply other threads:[~2018-06-20 9:34 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-24 13:26 [PATCH] locking/rwsem: Fix up_read_non_owner() warning with DEBUG_RWSEMS Waiman Long
2018-06-19 23:09 ` Waiman Long
2018-06-20 5:49 ` [Customers.Eckelmann] " Schenk, Gavin
2018-06-20 9:17 ` Peter Zijlstra
2018-06-20 9:33 ` tip-bot for Waiman Long [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=tip-03eeafdd9ab06a770d42c2b264d50dff7e2f4eee@git.kernel.org \
--to=tipbot@zytor.com \
--cc=arnd@arndb.de \
--cc=dan.j.williams@intel.com \
--cc=dave@stgolabs.net \
--cc=g.schenk@eckelmann.de \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=longman@redhat.com \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox