diff options
-rw-r--r-- | kernel/locking/lockdep.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c index a5d7db558928..511d30f88bce 100644 --- a/kernel/locking/lockdep.c +++ b/kernel/locking/lockdep.c | |||
@@ -3626,6 +3626,13 @@ __lock_release(struct lockdep_map *lock, int nested, unsigned long ip) | |||
3626 | curr->lockdep_depth = i; | 3626 | curr->lockdep_depth = i; |
3627 | curr->curr_chain_key = hlock->prev_chain_key; | 3627 | curr->curr_chain_key = hlock->prev_chain_key; |
3628 | 3628 | ||
3629 | /* | ||
3630 | * The most likely case is when the unlock is on the innermost | ||
3631 | * lock. In this case, we are done! | ||
3632 | */ | ||
3633 | if (i == depth-1) | ||
3634 | return 1; | ||
3635 | |||
3629 | if (reacquire_held_locks(curr, depth, i + 1)) | 3636 | if (reacquire_held_locks(curr, depth, i + 1)) |
3630 | return 0; | 3637 | return 0; |
3631 | 3638 | ||
@@ -3633,10 +3640,14 @@ __lock_release(struct lockdep_map *lock, int nested, unsigned long ip) | |||
3633 | * We had N bottles of beer on the wall, we drank one, but now | 3640 | * We had N bottles of beer on the wall, we drank one, but now |
3634 | * there's not N-1 bottles of beer left on the wall... | 3641 | * there's not N-1 bottles of beer left on the wall... |
3635 | */ | 3642 | */ |
3636 | if (DEBUG_LOCKS_WARN_ON(curr->lockdep_depth != depth - 1)) | 3643 | DEBUG_LOCKS_WARN_ON(curr->lockdep_depth != depth-1); |
3637 | return 0; | ||
3638 | 3644 | ||
3639 | return 1; | 3645 | /* |
3646 | * Since reacquire_held_locks() would have called check_chain_key() | ||
3647 | * indirectly via __lock_acquire(), we don't need to do it again | ||
3648 | * on return. | ||
3649 | */ | ||
3650 | return 0; | ||
3640 | } | 3651 | } |
3641 | 3652 | ||
3642 | static int __lock_is_held(const struct lockdep_map *lock, int read) | 3653 | static int __lock_is_held(const struct lockdep_map *lock, int read) |