summaryrefslogtreecommitdiffstats
path: root/xlators/protocol/server/src/server.c
diff options
context:
space:
mode:
authorAmar Tumballi <amar@gluster.com>2010-09-29 10:47:58 +0000
committerVijay Bellur <vijay@dev.gluster.com>2010-09-29 12:23:15 -0700
commit76b0e35e7809c38e62f33b5068c61623a6914d5f (patch)
tree86814d796cd6466095ea8715badc14f2b415e186 /xlators/protocol/server/src/server.c
parent0dc7064bd6047e9283d873f418d2e0a4e0ba29e6 (diff)
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 <amar@gluster.com> Signed-off-by: Vijay Bellur <vijay@dev.gluster.com> BUG: 971 (dynamic volume management) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=971
Diffstat (limited to 'xlators/protocol/server/src/server.c')
-rw-r--r--xlators/protocol/server/src/server.c3
1 files changed, 1 insertions, 2 deletions
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: