From b956f2389144ce19386770187ad7d17350a4bd1d Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Thu, 16 Sep 2010 01:08:15 +0000 Subject: protocol/client: prevent a crash while taking process state dump Signed-off-by: Amar Tumballi Signed-off-by: Vijay Bellur BUG: 1616 () URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1616 --- xlators/protocol/client/src/client.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'xlators/protocol/client/src') diff --git a/xlators/protocol/client/src/client.c b/xlators/protocol/client/src/client.c index 9b9873cfe85..4220afc6d66 100644 --- a/xlators/protocol/client/src/client.c +++ b/xlators/protocol/client/src/client.c @@ -1868,14 +1868,15 @@ client_priv_dump (xlator_t *this) gf_proc_dump_build_key(key, key_prefix, "last_received"); gf_proc_dump_write(key, "%s", ctime(&conf->last_received.tv_sec)); - gf_proc_dump_build_key(key, key_prefix, "total_bytes_read"); - gf_proc_dump_write(key, "%"PRIu64, - conf->rpc->conn.trans->total_bytes_read); - - gf_proc_dump_build_key(key, key_prefix, "total_bytes_written"); - gf_proc_dump_write(key, "%"PRIu64, - conf->rpc->conn.trans->total_bytes_write); + if (conf->rpc) { + gf_proc_dump_build_key(key, key_prefix, "total_bytes_read"); + gf_proc_dump_write(key, "%"PRIu64, + conf->rpc->conn.trans->total_bytes_read); + gf_proc_dump_build_key(key, key_prefix, "total_bytes_written"); + gf_proc_dump_write(key, "%"PRIu64, + conf->rpc->conn.trans->total_bytes_write); + } pthread_mutex_unlock(&conf->lock); return 0; -- cgit