]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
msg/async/rdma: do not init mutex before lockdeps is ready
authorKefu Chai <kchai@redhat.com>
Mon, 11 Nov 2019 14:11:48 +0000 (22:11 +0800)
committerKefu Chai <kchai@redhat.com>
Tue, 12 Nov 2019 03:26:39 +0000 (11:26 +0800)
commit56c03cc6a7f7a766eb74295ed57029039c56692a
tree17f7ab664c8fcb8df22acd3d6ab604033f24850f
parentc619ed809cd7d85f0e1b29d74ec5cd51b9325f87
msg/async/rdma: do not init mutex before lockdeps is ready

if we build ceph with lockdeps enabled, when a mutex is constructed,
a new id is allocated for it from the global free_ids table. but this
table is not initialized until lockdep_register_ceph_context() is
called. this function is not called until the global `CephContext`
instance is constructed. but, the order of initialization of global
variables is not defined. so we cannot let the initialization of
one global variable depend on the existence of one or more other
global variables.

so, in this change, the mutex is initialized by a static method instead.

Fixes: https://tracker.ceph.com/issues/42742
Signed-off-by: Kefu Chai <kchai@redhat.com>
src/msg/async/rdma/Infiniband.cc
src/msg/async/rdma/Infiniband.h