aboutsummaryrefslogtreecommitdiffstats
path: root/fs/locks.c
diff options
context:
space:
mode:
authorDaniel Wagner <daniel.wagner@bmw-carit.de>2015-04-03 09:04:03 -0400
committerJeff Layton <jeff.layton@primarydata.com>2015-04-03 09:04:03 -0400
commit663d5af750b8c025d0dfea2cf2a4b4a78cafa3a7 (patch)
treef8977690a5a9029b136758a2aac4058168af4784 /fs/locks.c
parent9b8c86956dea44276e2b2bb368f1f34895f4c5ea (diff)
locks: Add lockdep assertion for blocked_lock_lock
Annonate insert, remove and iterate function that we need blocked_lock_lock held. Signed-off-by: Daniel Wagner <daniel.wagner@bmw-carit.de> Signed-off-by: Jeff Layton <jeff.layton@primarydata.com>
Diffstat (limited to 'fs/locks.c')
-rw-r--r--fs/locks.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/locks.c b/fs/locks.c
index f88ed4506664..36cf93f165a8 100644
--- a/fs/locks.c
+++ b/fs/locks.c
@@ -592,11 +592,15 @@ posix_owner_key(struct file_lock *fl)
592 592
593static void locks_insert_global_blocked(struct file_lock *waiter) 593static void locks_insert_global_blocked(struct file_lock *waiter)
594{ 594{
595 lockdep_assert_held(&blocked_lock_lock);
596
595 hash_add(blocked_hash, &waiter->fl_link, posix_owner_key(waiter)); 597 hash_add(blocked_hash, &waiter->fl_link, posix_owner_key(waiter));
596} 598}
597 599
598static void locks_delete_global_blocked(struct file_lock *waiter) 600static void locks_delete_global_blocked(struct file_lock *waiter)
599{ 601{
602 lockdep_assert_held(&blocked_lock_lock);
603
600 hash_del(&waiter->fl_link); 604 hash_del(&waiter->fl_link);
601} 605}
602 606
@@ -838,6 +842,8 @@ static int posix_locks_deadlock(struct file_lock *caller_fl,
838{ 842{
839 int i = 0; 843 int i = 0;
840 844
845 lockdep_assert_held(&blocked_lock_lock);
846
841 /* 847 /*
842 * This deadlock detector can't reasonably detect deadlocks with 848 * This deadlock detector can't reasonably detect deadlocks with
843 * FL_OFDLCK locks, since they aren't owned by a process, per-se. 849 * FL_OFDLCK locks, since they aren't owned by a process, per-se.