From 76b0e35e7809c38e62f33b5068c61623a6914d5f Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Wed, 29 Sep 2010 10:47:58 +0000 Subject: protocol/server: set 'this->private' only if 'init()' is successful If volume file is fetched (due to HUP or volume file changes) and server init is called again, server protocol init fails with 'bind to port failed' error. If 'this->private' is set to new 'conf' before successful init, the whole process goes to corrupted state. Signed-off-by: Amar Tumballi Signed-off-by: Vijay Bellur BUG: 971 (dynamic volume management) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=971 --- xlators/protocol/server/src/server.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'xlators/protocol/server/src/server.c') diff --git a/xlators/protocol/server/src/server.c b/xlators/protocol/server/src/server.c index 58a57acee1f..719ffdc31cc 100644 --- a/xlators/protocol/server/src/server.c +++ b/xlators/protocol/server/src/server.c @@ -522,8 +522,6 @@ init (xlator_t *this) INIT_LIST_HEAD (&conf->xprt_list); pthread_mutex_init (&conf->mutex, NULL); - this->private = conf; - ret = server_build_config (this, conf); if (ret) goto out; @@ -621,6 +619,7 @@ init (xlator_t *this) } } #endif + this->private = conf; ret = 0; out: -- cgit