Commit 8e17d16f authored by Sunil Mushran's avatar Sunil Mushran Committed by Joel Becker

ocfs2/dlm: Cleanup mlogs in dlmthread.c, dlmast.c and dlmdomain.c

Add the domain name and the resource name in the mlogs.
Signed-off-by: default avatarSunil Mushran <sunil.mushran@oracle.com>
Signed-off-by: default avatarJoel Becker <joel.becker@oracle.com>
parent 50308d81
...@@ -90,19 +90,29 @@ static int dlm_should_cancel_bast(struct dlm_ctxt *dlm, struct dlm_lock *lock) ...@@ -90,19 +90,29 @@ static int dlm_should_cancel_bast(struct dlm_ctxt *dlm, struct dlm_lock *lock)
void __dlm_queue_ast(struct dlm_ctxt *dlm, struct dlm_lock *lock) void __dlm_queue_ast(struct dlm_ctxt *dlm, struct dlm_lock *lock)
{ {
mlog_entry_void(); struct dlm_lock_resource *res;
BUG_ON(!dlm); BUG_ON(!dlm);
BUG_ON(!lock); BUG_ON(!lock);
res = lock->lockres;
assert_spin_locked(&dlm->ast_lock); assert_spin_locked(&dlm->ast_lock);
if (!list_empty(&lock->ast_list)) { if (!list_empty(&lock->ast_list)) {
mlog(ML_ERROR, "ast list not empty!! pending=%d, newlevel=%d\n", mlog(ML_ERROR, "%s: res %.*s, lock %u:%llu, "
"AST list not empty, pending %d, newlevel %d\n",
dlm->name, res->lockname.len, res->lockname.name,
dlm_get_lock_cookie_node(be64_to_cpu(lock->ml.cookie)),
dlm_get_lock_cookie_seq(be64_to_cpu(lock->ml.cookie)),
lock->ast_pending, lock->ml.type); lock->ast_pending, lock->ml.type);
BUG(); BUG();
} }
if (lock->ast_pending) if (lock->ast_pending)
mlog(0, "lock has an ast getting flushed right now\n"); mlog(0, "%s: res %.*s, lock %u:%llu, AST getting flushed\n",
dlm->name, res->lockname.len, res->lockname.name,
dlm_get_lock_cookie_node(be64_to_cpu(lock->ml.cookie)),
dlm_get_lock_cookie_seq(be64_to_cpu(lock->ml.cookie)));
/* putting lock on list, add a ref */ /* putting lock on list, add a ref */
dlm_lock_get(lock); dlm_lock_get(lock);
...@@ -110,9 +120,10 @@ void __dlm_queue_ast(struct dlm_ctxt *dlm, struct dlm_lock *lock) ...@@ -110,9 +120,10 @@ void __dlm_queue_ast(struct dlm_ctxt *dlm, struct dlm_lock *lock)
/* check to see if this ast obsoletes the bast */ /* check to see if this ast obsoletes the bast */
if (dlm_should_cancel_bast(dlm, lock)) { if (dlm_should_cancel_bast(dlm, lock)) {
struct dlm_lock_resource *res = lock->lockres; mlog(0, "%s: res %.*s, lock %u:%llu, Cancelling BAST\n",
mlog(0, "%s: cancelling bast for %.*s\n", dlm->name, res->lockname.len, res->lockname.name,
dlm->name, res->lockname.len, res->lockname.name); dlm_get_lock_cookie_node(be64_to_cpu(lock->ml.cookie)),
dlm_get_lock_cookie_seq(be64_to_cpu(lock->ml.cookie)));
lock->bast_pending = 0; lock->bast_pending = 0;
list_del_init(&lock->bast_list); list_del_init(&lock->bast_list);
lock->ml.highest_blocked = LKM_IVMODE; lock->ml.highest_blocked = LKM_IVMODE;
...@@ -134,8 +145,6 @@ void __dlm_queue_ast(struct dlm_ctxt *dlm, struct dlm_lock *lock) ...@@ -134,8 +145,6 @@ void __dlm_queue_ast(struct dlm_ctxt *dlm, struct dlm_lock *lock)
void dlm_queue_ast(struct dlm_ctxt *dlm, struct dlm_lock *lock) void dlm_queue_ast(struct dlm_ctxt *dlm, struct dlm_lock *lock)
{ {
mlog_entry_void();
BUG_ON(!dlm); BUG_ON(!dlm);
BUG_ON(!lock); BUG_ON(!lock);
...@@ -147,15 +156,21 @@ void dlm_queue_ast(struct dlm_ctxt *dlm, struct dlm_lock *lock) ...@@ -147,15 +156,21 @@ void dlm_queue_ast(struct dlm_ctxt *dlm, struct dlm_lock *lock)
void __dlm_queue_bast(struct dlm_ctxt *dlm, struct dlm_lock *lock) void __dlm_queue_bast(struct dlm_ctxt *dlm, struct dlm_lock *lock)
{ {
mlog_entry_void(); struct dlm_lock_resource *res;
BUG_ON(!dlm); BUG_ON(!dlm);
BUG_ON(!lock); BUG_ON(!lock);
assert_spin_locked(&dlm->ast_lock); assert_spin_locked(&dlm->ast_lock);
res = lock->lockres;
BUG_ON(!list_empty(&lock->bast_list)); BUG_ON(!list_empty(&lock->bast_list));
if (lock->bast_pending) if (lock->bast_pending)
mlog(0, "lock has a bast getting flushed right now\n"); mlog(0, "%s: res %.*s, lock %u:%llu, BAST getting flushed\n",
dlm->name, res->lockname.len, res->lockname.name,
dlm_get_lock_cookie_node(be64_to_cpu(lock->ml.cookie)),
dlm_get_lock_cookie_seq(be64_to_cpu(lock->ml.cookie)));
/* putting lock on list, add a ref */ /* putting lock on list, add a ref */
dlm_lock_get(lock); dlm_lock_get(lock);
...@@ -167,8 +182,6 @@ void __dlm_queue_bast(struct dlm_ctxt *dlm, struct dlm_lock *lock) ...@@ -167,8 +182,6 @@ void __dlm_queue_bast(struct dlm_ctxt *dlm, struct dlm_lock *lock)
void dlm_queue_bast(struct dlm_ctxt *dlm, struct dlm_lock *lock) void dlm_queue_bast(struct dlm_ctxt *dlm, struct dlm_lock *lock)
{ {
mlog_entry_void();
BUG_ON(!dlm); BUG_ON(!dlm);
BUG_ON(!lock); BUG_ON(!lock);
...@@ -213,7 +226,10 @@ void dlm_do_local_ast(struct dlm_ctxt *dlm, struct dlm_lock_resource *res, ...@@ -213,7 +226,10 @@ void dlm_do_local_ast(struct dlm_ctxt *dlm, struct dlm_lock_resource *res,
dlm_astlockfunc_t *fn; dlm_astlockfunc_t *fn;
struct dlm_lockstatus *lksb; struct dlm_lockstatus *lksb;
mlog_entry_void(); mlog(0, "%s: res %.*s, lock %u:%llu, Local AST\n", dlm->name,
res->lockname.len, res->lockname.name,
dlm_get_lock_cookie_node(be64_to_cpu(lock->ml.cookie)),
dlm_get_lock_cookie_seq(be64_to_cpu(lock->ml.cookie)));
lksb = lock->lksb; lksb = lock->lksb;
fn = lock->ast; fn = lock->ast;
...@@ -231,7 +247,10 @@ int dlm_do_remote_ast(struct dlm_ctxt *dlm, struct dlm_lock_resource *res, ...@@ -231,7 +247,10 @@ int dlm_do_remote_ast(struct dlm_ctxt *dlm, struct dlm_lock_resource *res,
struct dlm_lockstatus *lksb; struct dlm_lockstatus *lksb;
int lksbflags; int lksbflags;
mlog_entry_void(); mlog(0, "%s: res %.*s, lock %u:%llu, Remote AST\n", dlm->name,
res->lockname.len, res->lockname.name,
dlm_get_lock_cookie_node(be64_to_cpu(lock->ml.cookie)),
dlm_get_lock_cookie_seq(be64_to_cpu(lock->ml.cookie)));
lksb = lock->lksb; lksb = lock->lksb;
BUG_ON(lock->ml.node == dlm->node_num); BUG_ON(lock->ml.node == dlm->node_num);
...@@ -250,9 +269,14 @@ void dlm_do_local_bast(struct dlm_ctxt *dlm, struct dlm_lock_resource *res, ...@@ -250,9 +269,14 @@ void dlm_do_local_bast(struct dlm_ctxt *dlm, struct dlm_lock_resource *res,
{ {
dlm_bastlockfunc_t *fn = lock->bast; dlm_bastlockfunc_t *fn = lock->bast;
mlog_entry_void();
BUG_ON(lock->ml.node != dlm->node_num); BUG_ON(lock->ml.node != dlm->node_num);
mlog(0, "%s: res %.*s, lock %u:%llu, Local BAST, blocked %d\n",
dlm->name, res->lockname.len, res->lockname.name,
dlm_get_lock_cookie_node(be64_to_cpu(lock->ml.cookie)),
dlm_get_lock_cookie_seq(be64_to_cpu(lock->ml.cookie)),
blocked_type);
(*fn)(lock->astdata, blocked_type); (*fn)(lock->astdata, blocked_type);
} }
...@@ -332,7 +356,8 @@ int dlm_proxy_ast_handler(struct o2net_msg *msg, u32 len, void *data, ...@@ -332,7 +356,8 @@ int dlm_proxy_ast_handler(struct o2net_msg *msg, u32 len, void *data,
/* cannot get a proxy ast message if this node owns it */ /* cannot get a proxy ast message if this node owns it */
BUG_ON(res->owner == dlm->node_num); BUG_ON(res->owner == dlm->node_num);
mlog(0, "lockres %.*s\n", res->lockname.len, res->lockname.name); mlog(0, "%s: res %.*s\n", dlm->name, res->lockname.len,
res->lockname.name);
spin_lock(&res->spinlock); spin_lock(&res->spinlock);
if (res->state & DLM_LOCK_RES_RECOVERING) { if (res->state & DLM_LOCK_RES_RECOVERING) {
...@@ -382,8 +407,12 @@ int dlm_proxy_ast_handler(struct o2net_msg *msg, u32 len, void *data, ...@@ -382,8 +407,12 @@ int dlm_proxy_ast_handler(struct o2net_msg *msg, u32 len, void *data,
if (past->type == DLM_AST) { if (past->type == DLM_AST) {
/* do not alter lock refcount. switching lists. */ /* do not alter lock refcount. switching lists. */
list_move_tail(&lock->list, &res->granted); list_move_tail(&lock->list, &res->granted);
mlog(0, "ast: Adding to granted list... type=%d, " mlog(0, "%s: res %.*s, lock %u:%llu, Granted type %d => %d\n",
"convert_type=%d\n", lock->ml.type, lock->ml.convert_type); dlm->name, res->lockname.len, res->lockname.name,
dlm_get_lock_cookie_node(be64_to_cpu(cookie)),
dlm_get_lock_cookie_seq(be64_to_cpu(cookie)),
lock->ml.type, lock->ml.convert_type);
if (lock->ml.convert_type != LKM_IVMODE) { if (lock->ml.convert_type != LKM_IVMODE) {
lock->ml.type = lock->ml.convert_type; lock->ml.type = lock->ml.convert_type;
lock->ml.convert_type = LKM_IVMODE; lock->ml.convert_type = LKM_IVMODE;
...@@ -426,9 +455,9 @@ int dlm_send_proxy_ast_msg(struct dlm_ctxt *dlm, struct dlm_lock_resource *res, ...@@ -426,9 +455,9 @@ int dlm_send_proxy_ast_msg(struct dlm_ctxt *dlm, struct dlm_lock_resource *res,
size_t veclen = 1; size_t veclen = 1;
int status; int status;
mlog_entry("res %.*s, to=%u, type=%d, blocked_type=%d\n", mlog(0, "%s: res %.*s, to %u, type %d, blocked_type %d\n", dlm->name,
res->lockname.len, res->lockname.name, lock->ml.node, res->lockname.len, res->lockname.name, lock->ml.node, msg_type,
msg_type, blocked_type); blocked_type);
memset(&past, 0, sizeof(struct dlm_proxy_ast)); memset(&past, 0, sizeof(struct dlm_proxy_ast));
past.node_idx = dlm->node_num; past.node_idx = dlm->node_num;
...@@ -441,7 +470,6 @@ int dlm_send_proxy_ast_msg(struct dlm_ctxt *dlm, struct dlm_lock_resource *res, ...@@ -441,7 +470,6 @@ int dlm_send_proxy_ast_msg(struct dlm_ctxt *dlm, struct dlm_lock_resource *res,
vec[0].iov_len = sizeof(struct dlm_proxy_ast); vec[0].iov_len = sizeof(struct dlm_proxy_ast);
vec[0].iov_base = &past; vec[0].iov_base = &past;
if (flags & DLM_LKSB_GET_LVB) { if (flags & DLM_LKSB_GET_LVB) {
mlog(0, "returning requested LVB data\n");
be32_add_cpu(&past.flags, LKM_GET_LVB); be32_add_cpu(&past.flags, LKM_GET_LVB);
vec[1].iov_len = DLM_LVB_LEN; vec[1].iov_len = DLM_LVB_LEN;
vec[1].iov_base = lock->lksb->lvb; vec[1].iov_base = lock->lksb->lvb;
...@@ -451,8 +479,8 @@ int dlm_send_proxy_ast_msg(struct dlm_ctxt *dlm, struct dlm_lock_resource *res, ...@@ -451,8 +479,8 @@ int dlm_send_proxy_ast_msg(struct dlm_ctxt *dlm, struct dlm_lock_resource *res,
ret = o2net_send_message_vec(DLM_PROXY_AST_MSG, dlm->key, vec, veclen, ret = o2net_send_message_vec(DLM_PROXY_AST_MSG, dlm->key, vec, veclen,
lock->ml.node, &status); lock->ml.node, &status);
if (ret < 0) if (ret < 0)
mlog(ML_ERROR, "Error %d when sending message %u (key 0x%x) to " mlog(ML_ERROR, "%s: res %.*s, error %d send AST to node %u\n",
"node %u\n", ret, DLM_PROXY_AST_MSG, dlm->key, dlm->name, res->lockname.len, res->lockname.name, ret,
lock->ml.node); lock->ml.node);
else { else {
if (status == DLM_RECOVERING) { if (status == DLM_RECOVERING) {
......
...@@ -460,8 +460,6 @@ static int dlm_migrate_all_locks(struct dlm_ctxt *dlm) ...@@ -460,8 +460,6 @@ static int dlm_migrate_all_locks(struct dlm_ctxt *dlm)
} }
cond_resched_lock(&dlm->spinlock); cond_resched_lock(&dlm->spinlock);
num += n; num += n;
mlog(0, "%s: touched %d lockreses in bucket %d "
"(tot=%d)\n", dlm->name, n, i, num);
} }
spin_unlock(&dlm->spinlock); spin_unlock(&dlm->spinlock);
wake_up(&dlm->dlm_thread_wq); wake_up(&dlm->dlm_thread_wq);
......
This diff is collapsed.
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