summaryrefslogtreecommitdiffstats
path: root/glusterfsd
diff options
context:
space:
mode:
authorAmar Tumballi <amar@gluster.com>2010-09-28 05:37:02 +0000
committerVijay Bellur <vijay@dev.gluster.com>2010-09-28 09:04:51 -0700
commit387f4d385e1d2c29af54c4f87eef7a07acfcfdf9 (patch)
tree22a63e2bac709e11329e76b445b1bd8739a12581 /glusterfsd
parent5ea64d983b31c6882d4582af71a339b6a4fcccf2 (diff)
more proper error returns in case of graph topology validation
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 'glusterfsd')
-rw-r--r--glusterfsd/src/glusterfsd-mgmt.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/glusterfsd/src/glusterfsd-mgmt.c b/glusterfsd/src/glusterfsd-mgmt.c
index 341d2267a..96d2c6681 100644
--- a/glusterfsd/src/glusterfsd-mgmt.c
+++ b/glusterfsd/src/glusterfsd-mgmt.c
@@ -252,13 +252,11 @@ glusterfs_volfile_reconfigure (FILE *newvolfile_fp)
oldvolfile_graph = glusterfs_graph_construct (oldvolfile_fp);
if (!oldvolfile_graph) {
- ret = -1;
goto out;
}
newvolfile_graph = glusterfs_graph_construct (newvolfile_fp);
if (!oldvolfile_graph) {
- ret = -1;
goto out;
}
@@ -267,7 +265,6 @@ glusterfs_volfile_reconfigure (FILE *newvolfile_fp)
gf_log ("glusterfsd-mgmt", GF_LOG_DEBUG,
"Graph topology not equal");
- ret = 0;
goto out;
}
@@ -280,7 +277,6 @@ glusterfs_volfile_reconfigure (FILE *newvolfile_fp)
if (!ctx) {
gf_log ("glusterfsd-mgmt", GF_LOG_ERROR,
"glusterfs_ctx_get() returned NULL");
- ret = -1;
goto out;
}
@@ -289,12 +285,10 @@ glusterfs_volfile_reconfigure (FILE *newvolfile_fp)
if (!oldvolfile_graph) {
gf_log ("glusterfsd-mgmt", GF_LOG_ERROR,
"glsuterfs_ctx->active is NULL");
- ret = -1;
goto out;
}
-
-
+ /* */
ret = glusterfs_graph_reconfigure (oldvolfile_graph,
newvolfile_graph);
if (ret) {
@@ -303,6 +297,7 @@ glusterfs_volfile_reconfigure (FILE *newvolfile_fp)
"graph");
}
+ ret = 0;
out:
return ret;
}
@@ -360,11 +355,10 @@ mgmt_getspec_cbk (struct rpc_req *req, struct iovec *iov, int count,
/* Check if only options have changed. No need to reload the
volfile if topology hasn't changed.
*/
-
ret = glusterfs_volfile_reconfigure (tmpfp);
if (!ret) {
gf_log ("glusterfsd-mgmt", GF_LOG_DEBUG,
- "No need to re-load volfile");
+ "No need to re-load volfile, reconfigure done");
goto out;
}