Skip to content

Commit

Permalink
locks: Add lockdep assertion for blocked_lock_lock
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Daniel Wagner authored and Jeff Layton committed Apr 3, 2015
1 parent 9b8c869 commit 663d5af
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions fs/locks.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 663d5af

Please sign in to comment.