From: Sage Weil Date: Wed, 2 Apr 2014 23:46:30 +0000 (-0700) Subject: lockdep: do not initialize if already started X-Git-Tag: v0.79~19^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=7a49f3da558c663d57928231ffb0c633d0b4e79c;p=ceph.git lockdep: do not initialize if already started If we have already registered a cct for lockdep, do not accept another one. We already check that the cct matches when we shut down. This we will run for the life span of a single cct and no longer. Fixes: #7965 Signed-off-by: Sage Weil --- diff --git a/src/common/lockdep.cc b/src/common/lockdep.cc index 5c2ee55abaad..e4376eaeda44 100644 --- a/src/common/lockdep.cc +++ b/src/common/lockdep.cc @@ -61,7 +61,10 @@ static BackTrace *follows[MAX_LOCKS][MAX_LOCKS]; // follows[a][b] means b void lockdep_register_ceph_context(CephContext *cct) { pthread_mutex_lock(&lockdep_mutex); - g_lockdep_ceph_ctx = cct; + if (g_lockdep_ceph_ctx == NULL) { + g_lockdep_ceph_ctx = cct; + lockdep_dout(0) << "lockdep start" << dendl; + } pthread_mutex_unlock(&lockdep_mutex); } @@ -69,6 +72,7 @@ void lockdep_unregister_ceph_context(CephContext *cct) { pthread_mutex_lock(&lockdep_mutex); if (cct == g_lockdep_ceph_ctx) { + lockdep_dout(0) << "lockdep stop" << dendl; // this cct is going away; shut it down! g_lockdep = false; g_lockdep_ceph_ctx = NULL; @@ -104,7 +108,6 @@ int lockdep_register(const char *name) int id; pthread_mutex_lock(&lockdep_mutex); - if (last_id == 0) for (int i=0; i *alt_def_args, } if (g_lockdep) { - dout(1) << "lockdep is enabled" << dendl; lockdep_register_ceph_context(g_ceph_context); } register_assert_context(g_ceph_context);