From 3709b2860688f4f9645a52006e3ede35b7d02830 Mon Sep 17 00:00:00 2001 From: Raghavendra Bhat Date: Thu, 14 Jun 2012 11:55:45 +0530 Subject: debug/io-stats: if some dict operation fails then goto out instead of proceeding Change-Id: I9c6d9b48c6162f6be2b405bacfc97605909c4e5e BUG: 769826 Signed-off-by: Raghavendra Bhat Reviewed-on: http://review.gluster.com/3569 Tested-by: Gluster Build System Reviewed-by: Jeff Darcy Reviewed-by: Pranith Kumar Karampuri Reviewed-by: Anand Avati --- xlators/debug/io-stats/src/io-stats.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'xlators/debug/io-stats/src') 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; -- cgit