[Ocfs2-commits] zab commits r2223 - trunk/fs/ocfs2/cluster
svn-commits at oss.oracle.com
svn-commits at oss.oracle.com
Fri May 6 18:19:17 CDT 2005
Author: zab
Signed-off-by: mfasheh
Signed-off-by: jlbec
Date: 2005-05-06 18:19:15 -0500 (Fri, 06 May 2005)
New Revision: 2223
Modified:
trunk/fs/ocfs2/cluster/masklog.h
trunk/fs/ocfs2/cluster/tcp.c
Log:
o add mlog_bug_on_msg() so we can get some data with assertions
o sprinkle some handler debugging around tcp.c
Signed-off-by: mfasheh
Signed-off-by: jlbec
Modified: trunk/fs/ocfs2/cluster/masklog.h
===================================================================
--- trunk/fs/ocfs2/cluster/masklog.h 2005-05-06 01:28:08 UTC (rev 2222)
+++ trunk/fs/ocfs2/cluster/masklog.h 2005-05-06 23:19:15 UTC (rev 2223)
@@ -224,6 +224,14 @@
mlog(ML_EXIT, "EXIT\n"); \
} while (0)
+#define mlog_bug_on_msg(cond, fmt, args...) do { \
+ if (cond) { \
+ mlog(ML_ERROR, "bug expression: " #cond "\n"); \
+ mlog(ML_ERROR, fmt, ##args); \
+ BUG(); \
+ } \
+} while (0)
+
#if (BITS_PER_LONG == 32) || defined(CONFIG_X86_64)
#define MLFi64 "lld"
#define MLFu64 "llu"
Modified: trunk/fs/ocfs2/cluster/tcp.c
===================================================================
--- trunk/fs/ocfs2/cluster/tcp.c 2005-05-06 01:28:08 UTC (rev 2222)
+++ trunk/fs/ocfs2/cluster/tcp.c 2005-05-06 23:19:15 UTC (rev 2223)
@@ -106,9 +106,9 @@
#include "masklog.h"
-#define __msg_fmt "[mag %u len %u typ %u status %d key %u num %u] "
+#define __msg_fmt "[mag %u len %u typ %u stat %d sys_stat %d key %u num %u] "
#define __msg_args __hdr->magic, __hdr->data_len, __hdr->msg_type, \
- __hdr->status, __hdr->key, __hdr->msg_num
+ __hdr->status, __hdr->sys_status, __hdr->key, __hdr->msg_num
#define msglog(hdr, fmt, args...) do { \
typeof(hdr) __hdr = (hdr); \
mlog(ML_MSG, __msg_fmt fmt, __msg_args, ##args); \
@@ -573,6 +573,14 @@
rb_link_node(&nmh->nh_node, parent, p);
rb_insert_color(&nmh->nh_node, &net_handler_tree);
list_add_tail(&nmh->nh_unregister_item, unreg_list);
+
+ mlog(ML_TCP, "registered handler func %p type %u key %u\n",
+ func, msg_type, key);
+ /* we've had some trouble with handlers seemingly vanishing. */
+ mlog_bug_on_msg(net_handler_tree_lookup(msg_type, key, &p,
+ &parent) == NULL,
+ "couldn't find handler we *just* registerd "
+ "for type %u key %u\n", msg_type, key);
}
write_unlock(&net_handler_lock);
if (ret)
@@ -595,6 +603,8 @@
list_for_each_safe(pos, n, list) {
nmh = list_entry(pos, struct net_msg_handler,
nh_unregister_item);
+ mlog(ML_TCP, "unregistering handler func %p type %u key %u\n",
+ nmh->nh_func, nmh->nh_msg_type, nmh->nh_key);
rb_erase(&nmh->nh_node, &net_handler_tree);
list_del_init(&nmh->nh_unregister_item);
kref_put(&nmh->nh_kref, net_handler_kref_release);
@@ -885,7 +895,7 @@
if (status && !ret)
*status = nsw.ns_status;
- mlog(0, "woken, returning system status %d, user status %d",
+ mlog(0, "woken, returning system status %d, user status %d\n",
ret, nsw.ns_status);
out:
if (sc)
@@ -1204,6 +1214,8 @@
handler_status = 0;
nmh = net_handler_get(hdr->msg_type, hdr->key);
if (!nmh) {
+ mlog(ML_TCP, "couldn't find handler for type %u key %u\n",
+ hdr->msg_type, hdr->key);
syserr = NET_ERR_NO_HNDLR;
goto out_respond;
}
More information about the Ocfs2-commits
mailing list