From: Sage Weil Date: Wed, 2 Apr 2014 23:43:10 +0000 (-0700) Subject: lockdep: reset state on shutdown X-Git-Tag: v0.79~19^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c43822cdaf3a029d15d630990911b4d6d43d2c73;p=ceph.git 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 --- diff --git a/src/common/lockdep.cc b/src/common/lockdep.cc index e4376eaeda449..6a8a1fa4cf018 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); }