From 64e3fada97bdb6dc4b885d6122e56eb93273503c Mon Sep 17 00:00:00 2001 From: Anand Avati Date: Wed, 27 Nov 2013 12:54:41 -0800 Subject: 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 Reviewed-on: http://review.gluster.org/6426 Reviewed-by: Kaleb KEITHLEY Tested-by: Gluster Build System --- xlators/features/index/src/index.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'xlators/features') 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: -- cgit