Commit b31cfc02 authored by Sunil Mushran's avatar Sunil Mushran Committed by Mark Fasheh

ocfs2/dlm: Add missing dlm_lockres_put()s

dlm_master_request_handler() forgot to put a lockres when
dlm_assert_master_worker() failed or was skipped.
Signed-off-by: default avatarSunil Mushran <sunil.mushran@oracle.com>
Signed-off-by: default avatarJoel Becker <joel.becker@oracle.com>
Signed-off-by: default avatarMark Fasheh <mark.fasheh@oracle.com>
parent 52987e2a
...@@ -1663,7 +1663,12 @@ int dlm_master_request_handler(struct o2net_msg *msg, u32 len, void *data, ...@@ -1663,7 +1663,12 @@ int dlm_master_request_handler(struct o2net_msg *msg, u32 len, void *data,
dlm_put_mle(tmpmle); dlm_put_mle(tmpmle);
} }
send_response: send_response:
/*
* __dlm_lookup_lockres() grabbed a reference to this lockres.
* The reference is released by dlm_assert_master_worker() under
* the call to dlm_dispatch_assert_master(). If
* dlm_assert_master_worker() isn't called, we drop it here.
*/
if (dispatch_assert) { if (dispatch_assert) {
if (response != DLM_MASTER_RESP_YES) if (response != DLM_MASTER_RESP_YES)
mlog(ML_ERROR, "invalid response %d\n", response); mlog(ML_ERROR, "invalid response %d\n", response);
...@@ -1678,7 +1683,11 @@ int dlm_master_request_handler(struct o2net_msg *msg, u32 len, void *data, ...@@ -1678,7 +1683,11 @@ int dlm_master_request_handler(struct o2net_msg *msg, u32 len, void *data,
if (ret < 0) { if (ret < 0) {
mlog(ML_ERROR, "failed to dispatch assert master work\n"); mlog(ML_ERROR, "failed to dispatch assert master work\n");
response = DLM_MASTER_RESP_ERROR; response = DLM_MASTER_RESP_ERROR;
dlm_lockres_put(res);
} }
} else {
if (res)
dlm_lockres_put(res);
} }
dlm_put(dlm); dlm_put(dlm);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment