diff options
author | Raghavendra Bhat <raghavendra@redhat.com> | 2012-06-14 11:55:45 +0530 |
---|---|---|
committer | Anand Avati <avati@redhat.com> | 2012-06-17 14:56:11 -0700 |
commit | 3709b2860688f4f9645a52006e3ede35b7d02830 (patch) | |
tree | c6070b82f57646d7e997838c6934413ddbf463a2 /xlators | |
parent | 310e29808b1aaa0208ccd13e2ba802007861231e (diff) |
debug/io-stats: if some dict operation fails then goto out instead of proceeding
Change-Id: I9c6d9b48c6162f6be2b405bacfc97605909c4e5e
BUG: 769826
Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com>
Reviewed-on: http://review.gluster.com/3569
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Reviewed-by: Pranith Kumar Karampuri <pranithk@gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'xlators')
-rw-r--r-- | xlators/debug/io-stats/src/io-stats.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/xlators/debug/io-stats/src/io-stats.c b/xlators/debug/io-stats/src/io-stats.c index 397b7dc5301..bb6151eda35 100644 --- a/xlators/debug/io-stats/src/io-stats.c +++ b/xlators/debug/io-stats/src/io-stats.c @@ -1114,7 +1114,10 @@ io_stats_dump_stats_to_dict (xlator_t *this, dict_t *resp, } unlock: UNLOCK (&conf->lock); - + /* Do not proceed if we came here because of some error + * during the dict operation */ + if (ret) + goto out; break; case IOS_STATS_TYPE_READ: list_head = &conf->list[IOS_STATS_TYPE_READ]; @@ -1175,7 +1178,10 @@ io_stats_dump_stats_to_dict (xlator_t *this, dict_t *resp, } unlock_list_head: UNLOCK (&list_head->lock); - + /* ret is !=0 if some dict operation in the above critical region + * failed. */ + if (ret) + goto out; ret = dict_set_int32 (resp, "members", cnt); out: return ret; |