diff options
author | Amar Tumballi <amar@gluster.com> | 2010-09-16 01:08:15 +0000 |
---|---|---|
committer | Vijay Bellur <vijay@dev.gluster.com> | 2010-09-16 04:22:58 -0700 |
commit | b956f2389144ce19386770187ad7d17350a4bd1d (patch) | |
tree | b2ec273c774c326e2174d636b4a2b0a189772660 /xlators/protocol | |
parent | f8accba64ce850bfb13bb3a4978ae8493ff5f6d4 (diff) |
protocol/client: prevent a crash while taking process state dump
Signed-off-by: Amar Tumballi <amar@gluster.com>
Signed-off-by: Vijay Bellur <vijay@dev.gluster.com>
BUG: 1616 ()
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1616
Diffstat (limited to 'xlators/protocol')
-rw-r--r-- | xlators/protocol/client/src/client.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/xlators/protocol/client/src/client.c b/xlators/protocol/client/src/client.c index 9b9873cfe..4220afc6d 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; |