[Ocfs2-devel] o2net: log socket state changes

Sunil Mushran sunil.mushran at oracle.com
Wed Mar 31 11:51:51 PDT 2010


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


Srinivas Eeda wrote:
> This patch logs socket state changes that lead to socket shutdown.
>
> Signed-off-by: Srinivas Eeda <srinivas.eeda at oracle.com>
> ---
>  fs/ocfs2/cluster/tcp.c |    3 +++
>  1 files changed, 3 insertions(+), 0 deletions(-)
>
> diff --git a/fs/ocfs2/cluster/tcp.c b/fs/ocfs2/cluster/tcp.c
> index 334f231..6d0d228 100644
> --- a/fs/ocfs2/cluster/tcp.c
> +++ b/fs/ocfs2/cluster/tcp.c
> @@ -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;
>  	}




More information about the Ocfs2-devel mailing list