diff options
| author | David S. Miller <davem@davemloft.net> | 2012-10-02 23:02:10 -0400 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2012-10-02 23:02:10 -0400 |
| commit | 954f9ac43b87b44152b8c21163cefd466a87145e (patch) | |
| tree | 31c4197f975c66c96976948663e6ce844900b41a /kernel/lockdep.c | |
| parent | 1b62ca7bf5775bed048032b7e779561e1fe66aa0 (diff) | |
| parent | 7fe0b14b725d6d09a1d9e1409bd465cb88b587f9 (diff) | |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux
There's a Niagara 2 memcpy fix in this tree and I have
a Kconfig fix from Dave Jones which requires the sparc-next
changes which went upstream yesterday.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'kernel/lockdep.c')
| -rw-r--r-- | kernel/lockdep.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/kernel/lockdep.c b/kernel/lockdep.c index ea9ee4518c35..7981e5b2350d 100644 --- a/kernel/lockdep.c +++ b/kernel/lockdep.c | |||
| @@ -2998,6 +2998,42 @@ EXPORT_SYMBOL_GPL(lockdep_init_map); | |||
| 2998 | 2998 | ||
| 2999 | struct lock_class_key __lockdep_no_validate__; | 2999 | struct lock_class_key __lockdep_no_validate__; |
| 3000 | 3000 | ||
| 3001 | static int | ||
| 3002 | print_lock_nested_lock_not_held(struct task_struct *curr, | ||
| 3003 | struct held_lock *hlock, | ||
| 3004 | unsigned long ip) | ||
| 3005 | { | ||
| 3006 | if (!debug_locks_off()) | ||
| 3007 | return 0; | ||
| 3008 | if (debug_locks_silent) | ||
| 3009 | return 0; | ||
| 3010 | |||
| 3011 | printk("\n"); | ||
| 3012 | printk("==================================\n"); | ||
| 3013 | printk("[ BUG: Nested lock was not taken ]\n"); | ||
| 3014 | print_kernel_ident(); | ||
| 3015 | printk("----------------------------------\n"); | ||
| 3016 | |||
| 3017 | printk("%s/%d is trying to lock:\n", curr->comm, task_pid_nr(curr)); | ||
| 3018 | print_lock(hlock); | ||
| 3019 | |||
| 3020 | printk("\nbut this task is not holding:\n"); | ||
| 3021 | printk("%s\n", hlock->nest_lock->name); | ||
| 3022 | |||
| 3023 | printk("\nstack backtrace:\n"); | ||
| 3024 | dump_stack(); | ||
| 3025 | |||
| 3026 | printk("\nother info that might help us debug this:\n"); | ||
| 3027 | lockdep_print_held_locks(curr); | ||
| 3028 | |||
| 3029 | printk("\nstack backtrace:\n"); | ||
| 3030 | dump_stack(); | ||
| 3031 | |||
| 3032 | return 0; | ||
| 3033 | } | ||
| 3034 | |||
| 3035 | static int __lock_is_held(struct lockdep_map *lock); | ||
| 3036 | |||
| 3001 | /* | 3037 | /* |
| 3002 | * This gets called for every mutex_lock*()/spin_lock*() operation. | 3038 | * This gets called for every mutex_lock*()/spin_lock*() operation. |
| 3003 | * We maintain the dependency maps and validate the locking attempt: | 3039 | * We maintain the dependency maps and validate the locking attempt: |
| @@ -3139,6 +3175,9 @@ static int __lock_acquire(struct lockdep_map *lock, unsigned int subclass, | |||
| 3139 | } | 3175 | } |
| 3140 | chain_key = iterate_chain_key(chain_key, id); | 3176 | chain_key = iterate_chain_key(chain_key, id); |
| 3141 | 3177 | ||
| 3178 | if (nest_lock && !__lock_is_held(nest_lock)) | ||
| 3179 | return print_lock_nested_lock_not_held(curr, hlock, ip); | ||
| 3180 | |||
| 3142 | if (!validate_chain(curr, lock, hlock, chain_head, chain_key)) | 3181 | if (!validate_chain(curr, lock, hlock, chain_head, chain_key)) |
| 3143 | return 0; | 3182 | return 0; |
| 3144 | 3183 | ||
