summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorNikhil Ladha <nladha@redhat.com>2021-02-10 15:07:32 +0530
committerGitHub <noreply@github.com>2021-02-10 10:37:32 +0100
commit5223300bc65eb88a1fbe27bd2702dbb92768cb27 (patch)
treea64ecc4a5951d66c07703497108cb878c9f627a1 /xlators
parent2572f096b2e6477e49009550d68e761e67676cc4 (diff)
downloadglusterfs-5223300bc65eb88a1fbe27bd2702dbb92768cb27.tar.gz
glusterfs-5223300bc65eb88a1fbe27bd2702dbb92768cb27.tar.xz
glusterfs-5223300bc65eb88a1fbe27bd2702dbb92768cb27.zip
glusterd: fix for starting brick on new port (#2090)
The Errno set by the runner code was not correct when the bind() fails to assign an already occupied port in the __socket_server_bind(). Fix: Updated the code to return the correct errno from the __socket_server_bind() if the bind() fails due to EADDRINUSE error. And, use the returned errno from runner_run() to retry allocating a new port to the brick process. Fixes: #1101 Change-Id: If124337f41344a04f050754e402490529ef4ecdc Signed-off-by: nik-redhat nladha@redhat.com
Diffstat (limited to 'xlators')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-utils.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c
index 962557c04e..eceb19a632 100644
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
@@ -2112,6 +2112,7 @@ glusterd_volume_start_glusterfs(glusterd_volinfo_t *volinfo,
ret = -1;
goto out;
}
+
/* Build the exp_path, before starting the glusterfsd even in
valgrind mode. Otherwise all the glusterfsd processes start
writing the valgrind log to the same file.
@@ -2268,13 +2269,10 @@ retry:
if (wait) {
synclock_unlock(&priv->big_lock);
- errno = 0;
ret = runner_run(&runner);
- if (errno != 0)
- ret = errno;
synclock_lock(&priv->big_lock);
- if (ret == EADDRINUSE) {
+ if (ret == -EADDRINUSE) {
/* retry after getting a new port */
gf_msg(this->name, GF_LOG_WARNING, -ret,
GD_MSG_SRC_BRICK_PORT_UNAVAIL,