summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnand Avati <avati@redhat.com>2013-11-27 12:54:41 -0800
committerAnand Avati <avati@redhat.com>2013-12-04 14:31:46 -0800
commit64e3fada97bdb6dc4b885d6122e56eb93273503c (patch)
tree2748d5347876a7538b10b89f4a1bfe94648ddc8d
parentdef8890d5ea7e73dfa37023e5d324be0bc289f5a (diff)
index: fix the order of initialization
thread spawning must be the last action. if not, failures after thread creation can set this->private to NULL and cause index_worker to segfault Change-Id: I71c85c25d7d6d1ed5f8d9c951db0262b8a3f1d90 BUG: 1034085 Signed-off-by: Anand Avati <avati@redhat.com> Reviewed-on: http://review.gluster.org/6426 Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
-rw-r--r--xlators/features/index/src/index.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/xlators/features/index/src/index.c b/xlators/features/index/src/index.c
index ed94aefad7c..2923e9c91de 100644
--- a/xlators/features/index/src/index.c
+++ b/xlators/features/index/src/index.c
@@ -1367,6 +1367,11 @@ init (xlator_t *this)
INIT_LIST_HEAD (&priv->callstubs);
this->private = priv;
+
+ ret = index_dir_create (this, XATTROP_SUBDIR);
+ if (ret < 0)
+ goto out;
+
ret = gf_thread_create (&thread, &w_attr, index_worker, this);
if (ret) {
gf_log (this->name, GF_LOG_WARNING, "Failed to create "
@@ -1374,9 +1379,6 @@ init (xlator_t *this)
goto out;
}
- ret = index_dir_create (this, XATTROP_SUBDIR);
- if (ret < 0)
- goto out;
ret = 0;
out: