From c43822cdaf3a029d15d630990911b4d6d43d2c73 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Wed, 2 Apr 2014 16:43:10 -0700 Subject: [PATCH] lockdep: reset state on shutdown If we shut down, clear out all of the lockdep state. This ensures that if we start up again on another cct, we will not be confused by old type ids and dependency state. Possibly contributed to #7965. Signed-off-by: Sage Weil --- src/common/lockdep.cc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/common/lockdep.cc b/src/common/lockdep.cc index e4376eaeda44..6a8a1fa4cf01 100644 --- a/src/common/lockdep.cc +++ b/src/common/lockdep.cc @@ -76,6 +76,15 @@ void lockdep_unregister_ceph_context(CephContext *cct) // this cct is going away; shut it down! g_lockdep = false; g_lockdep_ceph_ctx = NULL; + + // blow away all of our state, too, in case it starts up again. + held.clear(); + for (unsigned i = 0; i < MAX_LOCKS; ++i) + for (unsigned j = 0; j < MAX_LOCKS; ++j) + follows[i][j] = NULL; + lock_names.clear(); + lock_ids.clear(); + last_id = 0; } pthread_mutex_unlock(&lockdep_mutex); } -- 2.47.3