* [Ocfs2-devel] [PATCH] ocfs2: prints peer node number when sending tcp msg failed
@ 2010-03-10 13:12 Wengang Wang
2010-03-10 18:13 ` Sunil Mushran
0 siblings, 1 reply; 6+ messages in thread
From: Wengang Wang @ 2010-03-10 13:12 UTC (permalink / raw)
To: ocfs2-devel
This patch adds prints of the number of peer node to which sending tcp message
failed. It helps debugging.
Signed-off-by: Wengang Wang <wen.gang.wang@oracle.com>
---
fs/ocfs2/cluster/masklog.h | 9 +++++++++
fs/ocfs2/cluster/tcp.c | 9 +++++++--
fs/ocfs2/dlm/dlmast.c | 2 +-
fs/ocfs2/dlm/dlmconvert.c | 2 +-
fs/ocfs2/dlm/dlmunlock.c | 2 +-
5 files changed, 19 insertions(+), 5 deletions(-)
diff --git a/fs/ocfs2/cluster/masklog.h b/fs/ocfs2/cluster/masklog.h
index 3dfddbe..2af7e93 100644
--- a/fs/ocfs2/cluster/masklog.h
+++ b/fs/ocfs2/cluster/masklog.h
@@ -219,6 +219,15 @@ extern struct mlog_bits mlog_and_bits, mlog_not_bits;
mlog(ML_ERROR, "status = %lld\n", (long long)_st); \
} while (0)
+/* "node" is number of the node to which sending tcp msg failed */
+#define mlog_network_errno(st, node) do { \
+ int _st = (st); \
+ if (_st != -ERESTARTSYS && _st != -EINTR && \
+ _st != AOP_TRUNCATED_PAGE && _st != -ENOSPC) \
+ mlog(ML_ERROR, "failed to send msg to %u. " \
+ "errno: %lld\n", (u32)(node), (long long)_st); \
+} while (0)
+
#if defined(CONFIG_OCFS2_DEBUG_MASKLOG)
#define mlog_entry(fmt, args...) do { \
mlog(ML_ENTRY, "ENTRY:" fmt , ##args); \
diff --git a/fs/ocfs2/cluster/tcp.c b/fs/ocfs2/cluster/tcp.c
index d8d0c65..bdc4e9a 100644
--- a/fs/ocfs2/cluster/tcp.c
+++ b/fs/ocfs2/cluster/tcp.c
@@ -1092,12 +1092,17 @@ EXPORT_SYMBOL_GPL(o2net_send_message_vec);
int o2net_send_message(u32 msg_type, u32 key, void *data, u32 len,
u8 target_node, int *status)
{
+ int ret;
struct kvec vec = {
.iov_base = data,
.iov_len = len,
};
- return o2net_send_message_vec(msg_type, key, &vec, 1,
- target_node, status);
+
+ ret = o2net_send_message_vec(msg_type, key, &vec, 1,
+ target_node, status);
+ if (ret < 0)
+ mlog_network_errno(ret, target_node);
+ return ret;
}
EXPORT_SYMBOL_GPL(o2net_send_message);
diff --git a/fs/ocfs2/dlm/dlmast.c b/fs/ocfs2/dlm/dlmast.c
index dccc439..bc50076 100644
--- a/fs/ocfs2/dlm/dlmast.c
+++ b/fs/ocfs2/dlm/dlmast.c
@@ -453,7 +453,7 @@ 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,
lock->ml.node, &status);
if (ret < 0)
- mlog_errno(ret);
+ mlog_network_errno(ret, lock->ml.node);
else {
if (status == DLM_RECOVERING) {
mlog(ML_ERROR, "sent AST to node %u, it thinks this "
diff --git a/fs/ocfs2/dlm/dlmconvert.c b/fs/ocfs2/dlm/dlmconvert.c
index f283bce..ba30234 100644
--- a/fs/ocfs2/dlm/dlmconvert.c
+++ b/fs/ocfs2/dlm/dlmconvert.c
@@ -391,7 +391,7 @@ static enum dlm_status dlm_send_remote_convert_request(struct dlm_ctxt *dlm,
} else if (ret != DLM_NORMAL && ret != DLM_NOTQUEUED)
dlm_error(ret);
} else {
- mlog_errno(tmpret);
+ mlog_network_errno(tmpret, res->owner);
if (dlm_is_host_down(tmpret)) {
/* instead of logging the same network error over
* and over, sleep here and wait for the heartbeat
diff --git a/fs/ocfs2/dlm/dlmunlock.c b/fs/ocfs2/dlm/dlmunlock.c
index 49e29ec..acdc7fc 100644
--- a/fs/ocfs2/dlm/dlmunlock.c
+++ b/fs/ocfs2/dlm/dlmunlock.c
@@ -355,7 +355,7 @@ static enum dlm_status dlm_send_remote_unlock_request(struct dlm_ctxt *dlm,
mlog(0, "master was in-progress. retry\n");
ret = status;
} else {
- mlog_errno(tmpret);
+ mlog_network_errno(tmpret, owner);
if (dlm_is_host_down(tmpret)) {
/* NOTE: this seems strange, but it is what we want.
* when the master goes down during a cancel or
--
1.6.6.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [Ocfs2-devel] [PATCH] ocfs2: prints peer node number when sending tcp msg failed
2010-03-10 13:12 [Ocfs2-devel] [PATCH] ocfs2: prints peer node number when sending tcp msg failed Wengang Wang
@ 2010-03-10 18:13 ` Sunil Mushran
2010-03-11 3:21 ` Wengang Wang
0 siblings, 1 reply; 6+ messages in thread
From: Sunil Mushran @ 2010-03-10 18:13 UTC (permalink / raw)
To: ocfs2-devel
Yes knowing the node number will be very useful.
Wondering why not just have the mlog in o2net_send_message_vec().
Fewer changes. Do you see any downside?
Wengang Wang wrote:
> This patch adds prints of the number of peer node to which sending tcp message
> failed. It helps debugging.
>
> Signed-off-by: Wengang Wang <wen.gang.wang@oracle.com>
> ---
> fs/ocfs2/cluster/masklog.h | 9 +++++++++
> fs/ocfs2/cluster/tcp.c | 9 +++++++--
> fs/ocfs2/dlm/dlmast.c | 2 +-
> fs/ocfs2/dlm/dlmconvert.c | 2 +-
> fs/ocfs2/dlm/dlmunlock.c | 2 +-
> 5 files changed, 19 insertions(+), 5 deletions(-)
>
> diff --git a/fs/ocfs2/cluster/masklog.h b/fs/ocfs2/cluster/masklog.h
> index 3dfddbe..2af7e93 100644
> --- a/fs/ocfs2/cluster/masklog.h
> +++ b/fs/ocfs2/cluster/masklog.h
> @@ -219,6 +219,15 @@ extern struct mlog_bits mlog_and_bits, mlog_not_bits;
> mlog(ML_ERROR, "status = %lld\n", (long long)_st); \
> } while (0)
>
> +/* "node" is number of the node to which sending tcp msg failed */
> +#define mlog_network_errno(st, node) do { \
> + int _st = (st); \
> + if (_st != -ERESTARTSYS && _st != -EINTR && \
> + _st != AOP_TRUNCATED_PAGE && _st != -ENOSPC) \
> + mlog(ML_ERROR, "failed to send msg to %u. " \
> + "errno: %lld\n", (u32)(node), (long long)_st); \
> +} while (0)
> +
> #if defined(CONFIG_OCFS2_DEBUG_MASKLOG)
> #define mlog_entry(fmt, args...) do { \
> mlog(ML_ENTRY, "ENTRY:" fmt , ##args); \
> diff --git a/fs/ocfs2/cluster/tcp.c b/fs/ocfs2/cluster/tcp.c
> index d8d0c65..bdc4e9a 100644
> --- a/fs/ocfs2/cluster/tcp.c
> +++ b/fs/ocfs2/cluster/tcp.c
> @@ -1092,12 +1092,17 @@ EXPORT_SYMBOL_GPL(o2net_send_message_vec);
> int o2net_send_message(u32 msg_type, u32 key, void *data, u32 len,
> u8 target_node, int *status)
> {
> + int ret;
> struct kvec vec = {
> .iov_base = data,
> .iov_len = len,
> };
> - return o2net_send_message_vec(msg_type, key, &vec, 1,
> - target_node, status);
> +
> + ret = o2net_send_message_vec(msg_type, key, &vec, 1,
> + target_node, status);
> + if (ret < 0)
> + mlog_network_errno(ret, target_node);
> + return ret;
> }
> EXPORT_SYMBOL_GPL(o2net_send_message);
>
> diff --git a/fs/ocfs2/dlm/dlmast.c b/fs/ocfs2/dlm/dlmast.c
> index dccc439..bc50076 100644
> --- a/fs/ocfs2/dlm/dlmast.c
> +++ b/fs/ocfs2/dlm/dlmast.c
> @@ -453,7 +453,7 @@ 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,
> lock->ml.node, &status);
> if (ret < 0)
> - mlog_errno(ret);
> + mlog_network_errno(ret, lock->ml.node);
> else {
> if (status == DLM_RECOVERING) {
> mlog(ML_ERROR, "sent AST to node %u, it thinks this "
> diff --git a/fs/ocfs2/dlm/dlmconvert.c b/fs/ocfs2/dlm/dlmconvert.c
> index f283bce..ba30234 100644
> --- a/fs/ocfs2/dlm/dlmconvert.c
> +++ b/fs/ocfs2/dlm/dlmconvert.c
> @@ -391,7 +391,7 @@ static enum dlm_status dlm_send_remote_convert_request(struct dlm_ctxt *dlm,
> } else if (ret != DLM_NORMAL && ret != DLM_NOTQUEUED)
> dlm_error(ret);
> } else {
> - mlog_errno(tmpret);
> + mlog_network_errno(tmpret, res->owner);
> if (dlm_is_host_down(tmpret)) {
> /* instead of logging the same network error over
> * and over, sleep here and wait for the heartbeat
> diff --git a/fs/ocfs2/dlm/dlmunlock.c b/fs/ocfs2/dlm/dlmunlock.c
> index 49e29ec..acdc7fc 100644
> --- a/fs/ocfs2/dlm/dlmunlock.c
> +++ b/fs/ocfs2/dlm/dlmunlock.c
> @@ -355,7 +355,7 @@ static enum dlm_status dlm_send_remote_unlock_request(struct dlm_ctxt *dlm,
> mlog(0, "master was in-progress. retry\n");
> ret = status;
> } else {
> - mlog_errno(tmpret);
> + mlog_network_errno(tmpret, owner);
> if (dlm_is_host_down(tmpret)) {
> /* NOTE: this seems strange, but it is what we want.
> * when the master goes down during a cancel or
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Ocfs2-devel] [PATCH] ocfs2: prints peer node number when sending tcp msg failed
2010-03-10 18:13 ` Sunil Mushran
@ 2010-03-11 3:21 ` Wengang Wang
2010-03-12 2:08 ` Sunil Mushran
0 siblings, 1 reply; 6+ messages in thread
From: Wengang Wang @ 2010-03-11 3:21 UTC (permalink / raw)
To: ocfs2-devel
Hi Sunil,
On 10-03-10 10:13, Sunil Mushran wrote:
> Yes knowing the node number will be very useful.
>
> Wondering why not just have the mlog in o2net_send_message_vec().
> Fewer changes. Do you see any downside?
No very good reason just that I think there is rule that callers print
the error number returned by the callee.
If the above doesn't matter, of course your suggestion is better.
Or you meant we print the errno returned by o2net_send_tcp_msg() with
node number in o2net_send_message_vec()?
regards,
wengang.
> Wengang Wang wrote:
> >This patch adds prints of the number of peer node to which sending tcp message
> >failed. It helps debugging.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Ocfs2-devel] [PATCH] ocfs2: prints peer node number when sending tcp msg failed
2010-03-11 3:21 ` Wengang Wang
@ 2010-03-12 2:08 ` Sunil Mushran
2010-03-12 2:19 ` Sunil Mushran
2010-03-12 3:10 ` Wengang Wang
0 siblings, 2 replies; 6+ messages in thread
From: Sunil Mushran @ 2010-03-12 2:08 UTC (permalink / raw)
To: ocfs2-devel
Maybe what you are doing is better. One downside of doing it in
o2net_send_message_vec() is that we'll get one additional message.
And we don't want that.
But no need to add a macro. Use mlog(ML_ERROR). It will let us add
more stuff to the msg.
mlog(ML_ERROR, "Unable to send message %u (key 0x%x) to node %u\n", ...);
Sunil
Wengang Wang wrote:
> Hi Sunil,
>
> On 10-03-10 10:13, Sunil Mushran wrote:
>> Yes knowing the node number will be very useful.
>>
>> Wondering why not just have the mlog in o2net_send_message_vec().
>> Fewer changes. Do you see any downside?
>
> No very good reason just that I think there is rule that callers print
> the error number returned by the callee.
>
> If the above doesn't matter, of course your suggestion is better.
>
> Or you meant we print the errno returned by o2net_send_tcp_msg() with
> node number in o2net_send_message_vec()?
>
> regards,
> wengang.
>
>> Wengang Wang wrote:
>>> This patch adds prints of the number of peer node to which sending tcp message
>>> failed. It helps debugging.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Ocfs2-devel] [PATCH] ocfs2: prints peer node number when sending tcp msg failed
2010-03-12 2:08 ` Sunil Mushran
@ 2010-03-12 2:19 ` Sunil Mushran
2010-03-12 3:10 ` Wengang Wang
1 sibling, 0 replies; 6+ messages in thread
From: Sunil Mushran @ 2010-03-12 2:19 UTC (permalink / raw)
To: ocfs2-devel
oops... we need the error number.
mlog(ML_ERROR, "Error %d when sending message %u (key 0x%x) to node %u\n", ...);
Sunil Mushran wrote:
> Maybe what you are doing is better. One downside of doing it in
> o2net_send_message_vec() is that we'll get one additional message.
> And we don't want that.
>
> But no need to add a macro. Use mlog(ML_ERROR). It will let us add
> more stuff to the msg.
>
> mlog(ML_ERROR, "Unable to send message %u (key 0x%x) to node %u\n", ...);
>
> Sunil
>
>
> Wengang Wang wrote:
>
>> Hi Sunil,
>>
>> On 10-03-10 10:13, Sunil Mushran wrote:
>>
>>> Yes knowing the node number will be very useful.
>>>
>>> Wondering why not just have the mlog in o2net_send_message_vec().
>>> Fewer changes. Do you see any downside?
>>>
>> No very good reason just that I think there is rule that callers print
>> the error number returned by the callee.
>>
>> If the above doesn't matter, of course your suggestion is better.
>>
>> Or you meant we print the errno returned by o2net_send_tcp_msg() with
>> node number in o2net_send_message_vec()?
>>
>> regards,
>> wengang.
>>
>>
>>> Wengang Wang wrote:
>>>
>>>> This patch adds prints of the number of peer node to which sending tcp message
>>>> failed. It helps debugging.
>>>>
>
>
> _______________________________________________
> Ocfs2-devel mailing list
> Ocfs2-devel at oss.oracle.com
> http://oss.oracle.com/mailman/listinfo/ocfs2-devel
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Ocfs2-devel] [PATCH] ocfs2: prints peer node number when sending tcp msg failed
2010-03-12 2:08 ` Sunil Mushran
2010-03-12 2:19 ` Sunil Mushran
@ 2010-03-12 3:10 ` Wengang Wang
1 sibling, 0 replies; 6+ messages in thread
From: Wengang Wang @ 2010-03-12 3:10 UTC (permalink / raw)
To: ocfs2-devel
On 10-03-11 18:08, Sunil Mushran wrote:
> Maybe what you are doing is better. One downside of doing it in
> o2net_send_message_vec() is that we'll get one additional message.
> And we don't want that.
If this is a consideration, I would like to print the log where
o2net_send_message() is called instead of do it inside o2net_send_message().
>
> But no need to add a macro. Use mlog(ML_ERROR). It will let us add
> more stuff to the msg.
Ok.
> mlog(ML_ERROR, "Error %d when sending message %u (key 0x%x) to node
> %u\n", ...);
Got it.
regards,
wengang.
>
> Sunil
>
>
> Wengang Wang wrote:
> >Hi Sunil,
> >
> >On 10-03-10 10:13, Sunil Mushran wrote:
> >>Yes knowing the node number will be very useful.
> >>
> >>Wondering why not just have the mlog in o2net_send_message_vec().
> >>Fewer changes. Do you see any downside?
> >
> >No very good reason just that I think there is rule that callers print
> >the error number returned by the callee.
> >
> >If the above doesn't matter, of course your suggestion is better.
> >
> >Or you meant we print the errno returned by o2net_send_tcp_msg() with
> >node number in o2net_send_message_vec()?
> >
> >regards,
> >wengang.
> >>Wengang Wang wrote:
> >>>This patch adds prints of the number of peer node to which sending tcp message
> >>>failed. It helps debugging.
>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2010-03-12 3:10 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-10 13:12 [Ocfs2-devel] [PATCH] ocfs2: prints peer node number when sending tcp msg failed Wengang Wang
2010-03-10 18:13 ` Sunil Mushran
2010-03-11 3:21 ` Wengang Wang
2010-03-12 2:08 ` Sunil Mushran
2010-03-12 2:19 ` Sunil Mushran
2010-03-12 3:10 ` Wengang Wang
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.