summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/mgmt')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-op-sm.c11
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-utils.c18
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-utils.h3
3 files changed, 25 insertions, 7 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
index d548b95a8..80553b437 100644
--- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c
+++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
@@ -1450,14 +1450,15 @@ glusterd_op_status_volume (dict_t *dict, char **op_errstr,
vol_opts = volinfo->dict;
if ((cmd & GF_CLI_STATUS_NFS) != 0) {
- ret = glusterd_add_node_to_dict ("nfs", rsp_dict, 0);
+ ret = glusterd_add_node_to_dict ("nfs", rsp_dict, 0, vol_opts);
if (ret)
goto out;
other_count++;
node_count++;
} else if ((cmd & GF_CLI_STATUS_SHD) != 0) {
- ret = glusterd_add_node_to_dict ("glustershd", rsp_dict, 0);
+ ret = glusterd_add_node_to_dict ("glustershd", rsp_dict, 0,
+ vol_opts);
if (ret)
goto out;
other_count++;
@@ -1513,7 +1514,8 @@ glusterd_op_status_volume (dict_t *dict, char **op_errstr,
if (!nfs_disabled) {
ret = glusterd_add_node_to_dict ("nfs",
rsp_dict,
- other_index);
+ other_index,
+ vol_opts);
if (ret)
goto out;
other_index++;
@@ -1528,7 +1530,8 @@ glusterd_op_status_volume (dict_t *dict, char **op_errstr,
&& shd_enabled) {
ret = glusterd_add_node_to_dict ("glustershd",
rsp_dict,
- other_index);
+ other_index,
+ vol_opts);
if (ret)
goto out;
other_count++;
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c
index fc5a83e45..37899d4be 100644
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
@@ -2958,13 +2958,15 @@ glusterd_shd_stop ()
}
int
-glusterd_add_node_to_dict (char *server, dict_t *dict, int count)
+glusterd_add_node_to_dict (char *server, dict_t *dict, int count,
+ dict_t *vol_opts)
{
int ret = -1;
glusterd_conf_t *priv = THIS->private;
char pidfile[PATH_MAX] = {0,};
gf_boolean_t running = _gf_false;
int pid = -1;
+ int port = 0;
char key[1024] = {0,};
glusterd_get_nodesvc_pidfile (server, priv->workdir, pidfile,
@@ -2996,7 +2998,19 @@ glusterd_add_node_to_dict (char *server, dict_t *dict, int count)
memset (key, 0, sizeof (key));
snprintf (key, sizeof (key), "brick%d.port", count);
- ret = dict_set_int32 (dict, key, 0);
+ /* Port is available only for the NFS server.
+ * Self-heal daemon doesn't provide any port for access
+ * by entities other than gluster.
+ */
+ if (!strcmp (server, "nfs")) {
+ if (dict_get (vol_opts, "nfs.port")) {
+ ret = dict_get_int32 (vol_opts, "nfs.port", &port);
+ if (ret)
+ goto out;
+ } else
+ port = GF_NFS3_PORT;
+ }
+ ret = dict_set_int32 (dict, key, port);
if (ret)
goto out;
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.h b/xlators/mgmt/glusterd/src/glusterd-utils.h
index 9cea974c1..5491c7a00 100644
--- a/xlators/mgmt/glusterd/src/glusterd-utils.h
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.h
@@ -420,7 +420,8 @@ glusterd_add_bricks_hname_path_to_dict (dict_t *dict,
glusterd_volinfo_t *volinfo);
int
-glusterd_add_node_to_dict (char *server, dict_t *dict, int count);
+glusterd_add_node_to_dict (char *server, dict_t *dict, int count,
+ dict_t *vol_opts);
char *
glusterd_uuid_to_hostname (uuid_t uuid);