|
@@ -505,8 +505,10 @@ void dlm_change_lockres_owner(struct dlm_ctxt *dlm,
|
|
static void dlm_lockres_release(struct kref *kref)
|
|
static void dlm_lockres_release(struct kref *kref)
|
|
{
|
|
{
|
|
struct dlm_lock_resource *res;
|
|
struct dlm_lock_resource *res;
|
|
|
|
+ struct dlm_ctxt *dlm;
|
|
|
|
|
|
res = container_of(kref, struct dlm_lock_resource, refs);
|
|
res = container_of(kref, struct dlm_lock_resource, refs);
|
|
|
|
+ dlm = res->dlm;
|
|
|
|
|
|
/* This should not happen -- all lockres' have a name
|
|
/* This should not happen -- all lockres' have a name
|
|
* associated with them at init time. */
|
|
* associated with them at init time. */
|
|
@@ -515,6 +517,7 @@ static void dlm_lockres_release(struct kref *kref)
|
|
mlog(0, "destroying lockres %.*s\n", res->lockname.len,
|
|
mlog(0, "destroying lockres %.*s\n", res->lockname.len,
|
|
res->lockname.name);
|
|
res->lockname.name);
|
|
|
|
|
|
|
|
+ spin_lock(&dlm->track_lock);
|
|
if (!list_empty(&res->tracking))
|
|
if (!list_empty(&res->tracking))
|
|
list_del_init(&res->tracking);
|
|
list_del_init(&res->tracking);
|
|
else {
|
|
else {
|
|
@@ -522,6 +525,9 @@ static void dlm_lockres_release(struct kref *kref)
|
|
res->lockname.len, res->lockname.name);
|
|
res->lockname.len, res->lockname.name);
|
|
dlm_print_one_lock_resource(res);
|
|
dlm_print_one_lock_resource(res);
|
|
}
|
|
}
|
|
|
|
+ spin_unlock(&dlm->track_lock);
|
|
|
|
+
|
|
|
|
+ dlm_put(dlm);
|
|
|
|
|
|
if (!hlist_unhashed(&res->hash_node) ||
|
|
if (!hlist_unhashed(&res->hash_node) ||
|
|
!list_empty(&res->granted) ||
|
|
!list_empty(&res->granted) ||
|
|
@@ -595,6 +601,10 @@ static void dlm_init_lockres(struct dlm_ctxt *dlm,
|
|
res->migration_pending = 0;
|
|
res->migration_pending = 0;
|
|
res->inflight_locks = 0;
|
|
res->inflight_locks = 0;
|
|
|
|
|
|
|
|
+ /* put in dlm_lockres_release */
|
|
|
|
+ dlm_grab(dlm);
|
|
|
|
+ res->dlm = dlm;
|
|
|
|
+
|
|
kref_init(&res->refs);
|
|
kref_init(&res->refs);
|
|
|
|
|
|
/* just for consistency */
|
|
/* just for consistency */
|