summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
Diffstat (limited to 'xlators')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-mgmt.c35
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-snapshot.c27
2 files changed, 53 insertions, 9 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-mgmt.c b/xlators/mgmt/glusterd/src/glusterd-mgmt.c
index 852d60fb4..424bcca8a 100644
--- a/xlators/mgmt/glusterd/src/glusterd-mgmt.c
+++ b/xlators/mgmt/glusterd/src/glusterd-mgmt.c
@@ -448,12 +448,20 @@ gd_mgmt_v3_pre_validate_cbk_fn (struct rpc_req *req, struct iovec *iov,
}
pthread_mutex_unlock (&args->lock_dict);
- if (ret)
+ if (ret) {
gf_log ("", GF_LOG_ERROR, "%s",
"Failed to aggregate response from "
" node/brick");
- op_ret = rsp.op_ret;
- op_errno = rsp.op_errno;
+ if (!rsp.op_ret)
+ op_ret = ret;
+ else {
+ op_ret = rsp.op_ret;
+ op_errno = rsp.op_errno;
+ }
+ } else {
+ op_ret = rsp.op_ret;
+ op_errno = rsp.op_errno;
+ }
out:
if (rsp_dict)
dict_unref (rsp_dict);
@@ -852,15 +860,24 @@ gd_mgmt_v3_commit_cbk_fn (struct rpc_req *req, struct iovec *iov,
{
ret = glusterd_syncop_aggr_rsp_dict (rsp.op, args->dict,
rsp_dict);
- if (ret)
- gf_log ("", GF_LOG_ERROR, "%s",
- "Failed to aggregate response from "
- " node/brick");
}
pthread_mutex_unlock (&args->lock_dict);
- op_ret = rsp.op_ret;
- op_errno = rsp.op_errno;
+ if (ret) {
+ gf_log ("", GF_LOG_ERROR, "%s",
+ "Failed to aggregate response from "
+ " node/brick");
+ if (!rsp.op_ret)
+ op_ret = ret;
+ else {
+ op_ret = rsp.op_ret;
+ op_errno = rsp.op_errno;
+ }
+ } else {
+ op_ret = rsp.op_ret;
+ op_errno = rsp.op_errno;
+ }
+
out:
gd_mgmt_v3_collate_errors (args, op_ret, op_errno, NULL,
GLUSTERD_MGMT_V3_COMMIT,
diff --git a/xlators/mgmt/glusterd/src/glusterd-snapshot.c b/xlators/mgmt/glusterd/src/glusterd-snapshot.c
index 1f6930718..8386b44c5 100644
--- a/xlators/mgmt/glusterd/src/glusterd-snapshot.c
+++ b/xlators/mgmt/glusterd/src/glusterd-snapshot.c
@@ -3999,13 +3999,40 @@ glusterd_snapshot_create_commit (dict_t *dict, char **op_errstr,
gf_log (this->name, GF_LOG_ERROR, "Unable to fetch snap-name");
goto out;
}
+ tmp = gf_strdup (name);
+ if (!tmp) {
+ gf_log (this->name, GF_LOG_ERROR, "Out of memory");
+ goto out;
+ }
+
+ ret = dict_set_dynstr (rsp_dict, "snap-name", tmp);
+ if (ret) {
+ gf_log (this->name, GF_LOG_ERROR,
+ "Unable to set snap-name in rsp_dict");
+ GF_FREE (tmp);
+ goto out;
+ }
} else {
ret = dict_get_str (dict, "cg-name", &name);
if (ret) {
gf_log (this->name, GF_LOG_ERROR, "Unable to fetch cg-name");
goto out;
}
+ tmp = gf_strdup (name);
+ if (!tmp) {
+ gf_log (this->name, GF_LOG_ERROR, "Out of memory");
+ goto out;
+ }
+
+ ret = dict_set_str (rsp_dict, "cg-name", tmp);
+ if (ret) {
+ gf_log (this->name, GF_LOG_ERROR,
+ "Unable to set cg-name in rsp_dict");
+ GF_FREE (tmp);
+ goto out;
+ }
}
+ tmp = NULL;
ret = dict_get_bin (dict, "cg-id", (void **)&cg_id);
if (ret)