Skip to contentSkip to conversation

o2net: log socket state changes

Ocfs2-devel Srinivas Eeda 2 participants 3 messages Mar 31, 2010 OCFS2

lore
Share & tools
lore
#0 lore raw

This patch logs socket state changes that lead to socket shutdown.

---
 fs/ocfs2/cluster/tcp.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
fs/ocfs2/cluster/tcp.c +3 -0
index 334f231..6d0d228 100644
@@ -583,6 +583,9 @@ static void o2net_state_change(struct sock *sk)
 			o2net_sc_queue_work(sc, &sc->sc_connect_work);
 			break;
 		default:
+			printk(KERN_INFO SC_NODEF_FMT " socket state"
+			      " changed to %d. Shutting down the socket "
+			      "connection\n", SC_NODEF_ARGS(sc), sk->sk_state);
 			o2net_sc_queue_work(sc, &sc->sc_shutdown_work);
 			break;
 	}
Signature · 1 line
1.5.6.5
#1 lore raw

KERN_INFO is a good idea. But the message is a mouthful.

Currently it reads:
"node %s (num %u) at %u.%u.%u.%u:%u socket state changed to X. Shutting down the socket connection"

How about this:
"o2net: connection to node %s (num %u) at %u.%u.%u.%u:%u shutdown, state %d"

printk(KERN_INFO "connection to " SC_NODEF_FMT " shutdown, state %d" ....);

Sunil

Quoted 21 lines · Srinivas Eeda

This patch logs socket state changes that lead to socket shutdown.

---
 fs/ocfs2/cluster/tcp.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
fs/ocfs2/cluster/tcp.c +3 -0
index 334f231..6d0d228 100644
@@ -583,6 +583,9 @@ static void o2net_state_change(struct sock *sk)
 			o2net_sc_queue_work(sc, &sc->sc_connect_work);
 			break;
 		default:
+			printk(KERN_INFO SC_NODEF_FMT " socket state"
+			      " changed to %d. Shutting down the socket "
+			      "connection\n", SC_NODEF_ARGS(sc), sk->sk_state);
 			o2net_sc_queue_work(sc, &sc->sc_shutdown_work);
 			break;
 	}
#2 lore raw

Can you also provide a snippet of the messages after some mounts and umounts.

Quoted 45 lines · Sunil Mushran

KERN_INFO is a good idea. But the message is a mouthful.

Currently it reads:
"node %s (num %u) at %u.%u.%u.%u:%u socket state changed to X. Shutting down the socket connection"

How about this:
"o2net: connection to node %s (num %u) at %u.%u.%u.%u:%u shutdown, state %d"

printk(KERN_INFO "connection to " SC_NODEF_FMT " shutdown, state %d" ....);

Sunil

Quoted 13 lines · Srinivas Eeda

This patch logs socket state changes that lead to socket shutdown.

---
 fs/ocfs2/cluster/tcp.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
fs/ocfs2/cluster/tcp.c +0 -0
index 334f231..6d0d228 100644

fs/ocfs2/cluster/tcp.c static void o2net_state_change(struct sock *sk) · line 591

Quoted 9 lines
fs/ocfs2/cluster/tcp.c +3 -0
@@ -583,6 +583,9 @@ static void o2net_state_change(struct sock *sk)
 			o2net_sc_queue_work(sc, &sc->sc_connect_work);
 			break;
 		default:
+			printk(KERN_INFO SC_NODEF_FMT " socket state"
+			      " changed to %d. Shutting down the socket "
+			      "connection\n", SC_NODEF_ARGS(sc), sk->sk_state);
 			o2net_sc_queue_work(sc, &sc->sc_shutdown_work);
 			break;
 	}

_______________________________________________
Ocfs2-devel mailing list
Ocfs2-devel at oss.oracle.com
http://oss.oracle.com/mailman/listinfo/ocfs2-devel