Commit 34a9bff4 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'driver-core-3.14-rc2' of...

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
parents 41f76d8b da9846ae
...@@ -187,19 +187,23 @@ static void kernfs_deactivate(struct kernfs_node *kn) ...@@ -187,19 +187,23 @@ static void kernfs_deactivate(struct kernfs_node *kn)
kn->u.completion = (void *)&wait; 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 /* atomic_add_return() is a mb(), put_active() will always see
* the updated kn->u.completion. * the updated kn->u.completion.
*/ */
v = atomic_add_return(KN_DEACTIVATED_BIAS, &kn->active); v = atomic_add_return(KN_DEACTIVATED_BIAS, &kn->active);
if (v != KN_DEACTIVATED_BIAS) { 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); wait_for_completion(&wait);
} }
lock_acquired(&kn->dep_map, _RET_IP_); if (kn->flags & KERNFS_LOCKDEP) {
rwsem_release(&kn->dep_map, 1, _RET_IP_); lock_acquired(&kn->dep_map, _RET_IP_);
rwsem_release(&kn->dep_map, 1, _RET_IP_);
}
} }
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment