|
@@ -3188,7 +3188,7 @@ print_lock_nested_lock_not_held(struct task_struct *curr,
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|
|
-static int __lock_is_held(struct lockdep_map *lock);
|
|
|
|
|
|
+static int __lock_is_held(struct lockdep_map *lock, int read);
|
|
|
|
|
|
/*
|
|
/*
|
|
* This gets called for every mutex_lock*()/spin_lock*() operation.
|
|
* This gets called for every mutex_lock*()/spin_lock*() operation.
|
|
@@ -3329,7 +3329,7 @@ static int __lock_acquire(struct lockdep_map *lock, unsigned int subclass,
|
|
}
|
|
}
|
|
chain_key = iterate_chain_key(chain_key, class_idx);
|
|
chain_key = iterate_chain_key(chain_key, class_idx);
|
|
|
|
|
|
- if (nest_lock && !__lock_is_held(nest_lock))
|
|
|
|
|
|
+ if (nest_lock && !__lock_is_held(nest_lock, -1))
|
|
return print_lock_nested_lock_not_held(curr, hlock, ip);
|
|
return print_lock_nested_lock_not_held(curr, hlock, ip);
|
|
|
|
|
|
if (!validate_chain(curr, lock, hlock, chain_head, chain_key))
|
|
if (!validate_chain(curr, lock, hlock, chain_head, chain_key))
|
|
@@ -3576,7 +3576,7 @@ found_it:
|
|
return 1;
|
|
return 1;
|
|
}
|
|
}
|
|
|
|
|
|
-static int __lock_is_held(struct lockdep_map *lock)
|
|
|
|
|
|
+static int __lock_is_held(struct lockdep_map *lock, int read)
|
|
{
|
|
{
|
|
struct task_struct *curr = current;
|
|
struct task_struct *curr = current;
|
|
int i;
|
|
int i;
|
|
@@ -3584,8 +3584,12 @@ static int __lock_is_held(struct lockdep_map *lock)
|
|
for (i = 0; i < curr->lockdep_depth; i++) {
|
|
for (i = 0; i < curr->lockdep_depth; i++) {
|
|
struct held_lock *hlock = curr->held_locks + i;
|
|
struct held_lock *hlock = curr->held_locks + i;
|
|
|
|
|
|
- if (match_held_lock(hlock, lock))
|
|
|
|
- return 1;
|
|
|
|
|
|
+ if (match_held_lock(hlock, lock)) {
|
|
|
|
+ if (read == -1 || hlock->read == read)
|
|
|
|
+ return 1;
|
|
|
|
+
|
|
|
|
+ return 0;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
return 0;
|
|
return 0;
|
|
@@ -3769,7 +3773,7 @@ void lock_release(struct lockdep_map *lock, int nested,
|
|
}
|
|
}
|
|
EXPORT_SYMBOL_GPL(lock_release);
|
|
EXPORT_SYMBOL_GPL(lock_release);
|
|
|
|
|
|
-int lock_is_held(struct lockdep_map *lock)
|
|
|
|
|
|
+int lock_is_held_type(struct lockdep_map *lock, int read)
|
|
{
|
|
{
|
|
unsigned long flags;
|
|
unsigned long flags;
|
|
int ret = 0;
|
|
int ret = 0;
|
|
@@ -3781,13 +3785,13 @@ int lock_is_held(struct lockdep_map *lock)
|
|
check_flags(flags);
|
|
check_flags(flags);
|
|
|
|
|
|
current->lockdep_recursion = 1;
|
|
current->lockdep_recursion = 1;
|
|
- ret = __lock_is_held(lock);
|
|
|
|
|
|
+ ret = __lock_is_held(lock, read);
|
|
current->lockdep_recursion = 0;
|
|
current->lockdep_recursion = 0;
|
|
raw_local_irq_restore(flags);
|
|
raw_local_irq_restore(flags);
|
|
|
|
|
|
return ret;
|
|
return ret;
|
|
}
|
|
}
|
|
-EXPORT_SYMBOL_GPL(lock_is_held);
|
|
|
|
|
|
+EXPORT_SYMBOL_GPL(lock_is_held_type);
|
|
|
|
|
|
struct pin_cookie lock_pin_lock(struct lockdep_map *lock)
|
|
struct pin_cookie lock_pin_lock(struct lockdep_map *lock)
|
|
{
|
|
{
|