aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/dlm/dlmmaster.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ocfs2/dlm/dlmmaster.c')
-rw-r--r--fs/ocfs2/dlm/dlmmaster.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/fs/ocfs2/dlm/dlmmaster.c b/fs/ocfs2/dlm/dlmmaster.c
index c92d1b19fc0b..ea6b89577860 100644
--- a/fs/ocfs2/dlm/dlmmaster.c
+++ b/fs/ocfs2/dlm/dlmmaster.c
@@ -1663,7 +1663,12 @@ way_up_top:
1663 dlm_put_mle(tmpmle); 1663 dlm_put_mle(tmpmle);
1664 } 1664 }
1665send_response: 1665send_response:
1666 1666 /*
1667 * __dlm_lookup_lockres() grabbed a reference to this lockres.
1668 * The reference is released by dlm_assert_master_worker() under
1669 * the call to dlm_dispatch_assert_master(). If
1670 * dlm_assert_master_worker() isn't called, we drop it here.
1671 */
1667 if (dispatch_assert) { 1672 if (dispatch_assert) {
1668 if (response != DLM_MASTER_RESP_YES) 1673 if (response != DLM_MASTER_RESP_YES)
1669 mlog(ML_ERROR, "invalid response %d\n", response); 1674 mlog(ML_ERROR, "invalid response %d\n", response);
@@ -1678,7 +1683,11 @@ send_response:
1678 if (ret < 0) { 1683 if (ret < 0) {
1679 mlog(ML_ERROR, "failed to dispatch assert master work\n"); 1684 mlog(ML_ERROR, "failed to dispatch assert master work\n");
1680 response = DLM_MASTER_RESP_ERROR; 1685 response = DLM_MASTER_RESP_ERROR;
1686 dlm_lockres_put(res);
1681 } 1687 }
1688 } else {
1689 if (res)
1690 dlm_lockres_put(res);
1682 } 1691 }
1683 1692
1684 dlm_put(dlm); 1693 dlm_put(dlm);
@@ -2348,7 +2357,7 @@ int dlm_deref_lockres_handler(struct o2net_msg *msg, u32 len, void *data,
2348 mlog(ML_ERROR, "%s:%.*s: node %u trying to drop ref " 2357 mlog(ML_ERROR, "%s:%.*s: node %u trying to drop ref "
2349 "but it is already dropped!\n", dlm->name, 2358 "but it is already dropped!\n", dlm->name,
2350 res->lockname.len, res->lockname.name, node); 2359 res->lockname.len, res->lockname.name, node);
2351 __dlm_print_one_lock_resource(res); 2360 dlm_print_one_lock_resource(res);
2352 } 2361 }
2353 ret = 0; 2362 ret = 0;
2354 goto done; 2363 goto done;
@@ -2408,7 +2417,7 @@ static void dlm_deref_lockres_worker(struct dlm_work_item *item, void *data)
2408 mlog(ML_ERROR, "%s:%.*s: node %u trying to drop ref " 2417 mlog(ML_ERROR, "%s:%.*s: node %u trying to drop ref "
2409 "but it is already dropped!\n", dlm->name, 2418 "but it is already dropped!\n", dlm->name,
2410 res->lockname.len, res->lockname.name, node); 2419 res->lockname.len, res->lockname.name, node);
2411 __dlm_print_one_lock_resource(res); 2420 dlm_print_one_lock_resource(res);
2412 } 2421 }
2413 2422
2414 dlm_lockres_put(res); 2423 dlm_lockres_put(res);
@@ -2933,6 +2942,9 @@ static void dlm_remove_nonlocal_locks(struct dlm_ctxt *dlm,
2933 dlm_lockres_clear_refmap_bit(lock->ml.node, res); 2942 dlm_lockres_clear_refmap_bit(lock->ml.node, res);
2934 list_del_init(&lock->list); 2943 list_del_init(&lock->list);
2935 dlm_lock_put(lock); 2944 dlm_lock_put(lock);
2945 /* In a normal unlock, we would have added a
2946 * DLM_UNLOCK_FREE_LOCK action. Force it. */
2947 dlm_lock_put(lock);
2936 } 2948 }
2937 } 2949 }
2938 queue++; 2950 queue++;