]> git-server-git.apps.pok.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)
committerNathan Cutler <ncutler@suse.com>
Tue, 23 Jan 2018 23:07:24 +0000 (00:07 +0100)
commit49ac68c3f95a0bdccb7a6c2f1706a3784ffc706a
tree2c67405e15ac021119185e189f06a2e61ba03acd
parentb66ba62822bc7935d60a4424cedbfe7a845631c6
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>
(cherry picked from commit 75f41a95782a7ee83a243d91963e8d591402f8a6)
src/common/lockdep.cc