From: Daniel Wagner <daniel.wagner@bmw-carit.de>
To: Jeff Layton <jlayton@primarydata.com>
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
Daniel Wagner <daniel.wagner@bmw-carit.de>
Subject: [RFC v2 2/4] locks: Add lockdep assertion for blocked_lock_lock
Date: Mon, 2 Mar 2015 15:25:11 +0100 [thread overview]
Message-ID: <1425306313-7234-3-git-send-email-daniel.wagner@bmw-carit.de> (raw)
In-Reply-To: <1425306313-7234-1-git-send-email-daniel.wagner@bmw-carit.de>
Annonate insert, remove and iterate function that we need
blocked_lock_lock held.
Signed-off-by: Daniel Wagner <daniel.wagner@bmw-carit.de>
---
fs/locks.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/fs/locks.c b/fs/locks.c
index f63aa92..4498da0 100644
--- a/fs/locks.c
+++ b/fs/locks.c
@@ -592,11 +592,15 @@ posix_owner_key(struct file_lock *fl)
static void locks_insert_global_blocked(struct file_lock *waiter)
{
+ lockdep_assert_held(&blocked_lock_lock);
+
hash_add(blocked_hash, &waiter->fl_link, posix_owner_key(waiter));
}
static void locks_delete_global_blocked(struct file_lock *waiter)
{
+ lockdep_assert_held(&blocked_lock_lock);
+
hash_del(&waiter->fl_link);
}
@@ -838,6 +842,8 @@ static int posix_locks_deadlock(struct file_lock *caller_fl,
{
int i = 0;
+ lockdep_assert_held(&blocked_lock_lock);
+
/*
* This deadlock detector can't reasonably detect deadlocks with
* FL_OFDLCK locks, since they aren't owned by a process, per-se.
--
2.1.0
next prev parent reply other threads:[~2015-03-02 14:25 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-02 14:25 [RFC v2 0/4] fs/locks: Use plain percpu spinlocks instead of lglock to protect file_lock Daniel Wagner
2015-03-02 14:25 ` [RFC v2 1/4] locks: Remove unnecessary IS_POSIX test Daniel Wagner
2015-03-03 0:55 ` Jeff Layton
2015-03-02 14:25 ` Daniel Wagner [this message]
2015-03-03 0:55 ` [RFC v2 2/4] locks: Add lockdep assertion for blocked_lock_lock Jeff Layton
2015-03-02 14:25 ` [RFC v2 3/4] locks: Split insert/delete block functions into flock/posix parts Daniel Wagner
2015-03-03 0:55 ` Jeff Layton
2015-03-04 14:20 ` Daniel Wagner
2015-03-04 15:00 ` Boaz Harrosh
2015-03-04 15:32 ` Daniel Wagner
2015-03-04 17:59 ` Jeff Layton
2015-03-04 19:16 ` Jeff Layton
2015-03-04 21:01 ` Jeff Layton
2015-03-04 21:12 ` Jeff Layton
2015-03-04 21:13 ` Daniel Wagner
2015-03-02 14:25 ` [RFC v2 4/4] locks: Use blocked_lock_lock only to protect blocked_hash Daniel Wagner
2015-03-03 0:58 ` Jeff Layton
2015-03-02 15:23 ` [RFC v2 0/4] fs/locks: Use plain percpu spinlocks instead of lglock to protect file_lock Jeff Layton
2015-03-02 16:44 ` Daniel Wagner
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=1425306313-7234-3-git-send-email-daniel.wagner@bmw-carit.de \
--to=daniel.wagner@bmw-carit.de \
--cc=jlayton@primarydata.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).