diff options
author | Amar Tumballi <amar@gluster.com> | 2010-10-14 05:12:12 +0000 |
---|---|---|
committer | Anand V. Avati <avati@dev.gluster.com> | 2010-10-26 03:01:56 -0700 |
commit | 29377452062b07b6487105ebe65a717898e19e2a (patch) | |
tree | 1121353b8efe8d5537768d2197b0b1169a8af31b /xlators/debug/io-stats/src | |
parent | 0d11145c0c2a9bac61398bff2fbab14820f0764a (diff) |
io-stats: handle the case of 'cleanup_and_exit()' properly
Signed-off-by: Amar Tumballi <amar@gluster.com>
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
BUG: 1933 (Segfault while expansion of volume from distributed mirror)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1933
Diffstat (limited to 'xlators/debug/io-stats/src')
-rw-r--r-- | xlators/debug/io-stats/src/io-stats.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/xlators/debug/io-stats/src/io-stats.c b/xlators/debug/io-stats/src/io-stats.c index 90f02b6ee..fff16ede2 100644 --- a/xlators/debug/io-stats/src/io-stats.c +++ b/xlators/debug/io-stats/src/io-stats.c @@ -91,8 +91,8 @@ struct ios_local { struct ios_conf *conf = NULL; \ \ conf = this->private; \ - if (conf->measure_latency) { \ - gettimeofday (&frame->end, NULL); \ + if (conf && conf->measure_latency) { \ + gettimeofday (&frame->end, NULL); \ update_ios_latency (conf, frame, GF_FOP_##op); \ } \ } while (0) @@ -102,8 +102,8 @@ struct ios_local { struct ios_conf *conf = NULL; \ \ conf = this->private; \ - if (conf->measure_latency) { \ - gettimeofday (&frame->begin, NULL); \ + if (conf && conf->measure_latency) { \ + gettimeofday (&frame->begin, NULL); \ } \ } while (0) @@ -113,6 +113,8 @@ struct ios_local { struct ios_conf *conf = NULL; \ \ conf = this->private; \ + if (!conf) \ + break; \ LOCK (&conf->lock); \ { \ conf->cumulative.fop_hits[GF_FOP_##op]++; \ @@ -131,6 +133,8 @@ struct ios_local { conf = this->private; \ lb2 = log_base2 (len); \ ios_fd_ctx_get (fd, this, &iosfd); \ + if (!conf) \ + break; \ \ LOCK (&conf->lock); \ { \ @@ -157,6 +161,8 @@ struct ios_local { conf = this->private; \ lb2 = log_base2 (len); \ ios_fd_ctx_get (fd, this, &iosfd); \ + if (!conf) \ + break; \ \ LOCK (&conf->lock); \ { \ |