]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
lockdep: fix races with concurrent lockdep teardown
authorJeff Layton <jlayton@redhat.com>
Thu, 14 Sep 2017 13:28:34 +0000 (09:28 -0400)
committerJeff Layton <jlayton@redhat.com>
Sat, 16 Sep 2017 11:57:04 +0000 (07:57 -0400)
commit75f41a95782a7ee83a243d91963e8d591402f8a6
tree61f5e92ef3333ed76ba45fefd7ffa2a3001d5598
parent01863bb6fb62ea89aa3e21e43bf4dc4f3da9cfcb
lockdep: fix races with concurrent lockdep teardown

If the cct is unregistered while other threads are flogging mutexes,
then we can hit all sorts of bugs. Ensure that we handle that
situation sanely, by checking that g_lockdep is still set after
we take the lockdep_mutex.

Also, remove an assertion from lockdep_unregister, and just turn it into
an immediate return. It's possible to have a call to
lockdep_unregister_ceph_context, and then a call to
lockdep_register_ceph_context while a mutex is being held by another
task.

In that case, it's possible the lock does not exist in the map
when we go to unregister it. That's not a bug though, just a natural
consequence of that series of actions.

Tracker: http://tracker.ceph.com/issues/20988
Signed-off-by: Jeff Layton <jlayton@redhat.com>
src/common/lockdep.cc