From 41266ec75d729c53ab748aa2ac1fa0d0515b97d6 Mon Sep 17 00:00:00 2001 From: vmallika Date: Mon, 6 Jul 2015 16:18:45 +0530 Subject: quotad: create sock listener only after graph init is complete If FOPs are received before completing graph initialization, FOP path can crash while accessing uninitialized variables This patch fixes issue by not creating listener until graph initialization is complete and hence not receiving FOP request Change-Id: I4771e376410843dff44bfe819329a4632523d266 BUG: 1240254 Signed-off-by: vmallika Reviewed-on: http://review.gluster.org/11552 Tested-by: NetBSD Build System Tested-by: Gluster Build System Reviewed-by: Raghavendra G --- xlators/features/quota/src/quotad-aggregator.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'xlators/features/quota/src/quotad-aggregator.c') diff --git a/xlators/features/quota/src/quotad-aggregator.c b/xlators/features/quota/src/quotad-aggregator.c index 6c9c40a122f..8a7cfdca3f5 100644 --- a/xlators/features/quota/src/quotad-aggregator.c +++ b/xlators/features/quota/src/quotad-aggregator.c @@ -374,6 +374,11 @@ quotad_aggregator_init (xlator_t *this) priv = this->private; + if (priv->rpcsvc) { + /* Listener already created */ + return 0; + } + ret = dict_set_str (this->options, "transport.address-family", "unix"); if (ret) goto out; @@ -423,6 +428,11 @@ quotad_aggregator_init (xlator_t *this) ret = 0; out: + if (ret && priv->rpcsvc) { + GF_FREE (priv->rpcsvc); + priv->rpcsvc = NULL; + } + return ret; } -- cgit