mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-03 22:57:21 -04:00
Merge tag 'driver-core-3.14-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core
Pull driver core fix from Greg KH: "Here is a single kernfs fix to resolve a much-reported lockdep issue with the removal of entries in sysfs" * tag 'driver-core-3.14-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: kernfs: make kernfs_deactivate() honor KERNFS_LOCKDEP flag
This commit is contained in:
@@ -187,19 +187,23 @@ static void kernfs_deactivate(struct kernfs_node *kn)
|
||||
|
||||
kn->u.completion = (void *)&wait;
|
||||
|
||||
rwsem_acquire(&kn->dep_map, 0, 0, _RET_IP_);
|
||||
if (kn->flags & KERNFS_LOCKDEP)
|
||||
rwsem_acquire(&kn->dep_map, 0, 0, _RET_IP_);
|
||||
/* atomic_add_return() is a mb(), put_active() will always see
|
||||
* the updated kn->u.completion.
|
||||
*/
|
||||
v = atomic_add_return(KN_DEACTIVATED_BIAS, &kn->active);
|
||||
|
||||
if (v != KN_DEACTIVATED_BIAS) {
|
||||
lock_contended(&kn->dep_map, _RET_IP_);
|
||||
if (kn->flags & KERNFS_LOCKDEP)
|
||||
lock_contended(&kn->dep_map, _RET_IP_);
|
||||
wait_for_completion(&wait);
|
||||
}
|
||||
|
||||
lock_acquired(&kn->dep_map, _RET_IP_);
|
||||
rwsem_release(&kn->dep_map, 1, _RET_IP_);
|
||||
if (kn->flags & KERNFS_LOCKDEP) {
|
||||
lock_acquired(&kn->dep_map, _RET_IP_);
|
||||
rwsem_release(&kn->dep_map, 1, _RET_IP_);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user