summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd
diff options
context:
space:
mode:
authorshishir gowda <shishirng@gluster.com>2011-04-14 00:05:39 +0000
committerAnand Avati <avati@gluster.com>2011-04-14 01:00:41 -0700
commit1875dd6c05a5964b46ce38f1bd3c0679ad5d17bf (patch)
treebb30cf143c98fdbbb47ea1b81001efa48b1dde9d /xlators/mgmt/glusterd
parentb3c2bbab35695a2358a4031aa05e31eb5e19c28b (diff)
glusterd: Respond to cli with empty iobref is serialize fails.
This usually happens if the size exceeds 128k. Earlier the cli used to hang if the response exceeded 128k size. Signed-off-by: shishir gowda <shishirng@gluster.com> Signed-off-by: Anand Avati <avati@gluster.com> BUG: 2725 (volume top displays "error" for path max) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2725
Diffstat (limited to 'xlators/mgmt/glusterd')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-rpc-ops.c2
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-utils.c8
2 files changed, 5 insertions, 5 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-rpc-ops.c b/xlators/mgmt/glusterd/src/glusterd-rpc-ops.c
index 2b0f87fb0..8600c7b93 100644
--- a/xlators/mgmt/glusterd/src/glusterd-rpc-ops.c
+++ b/xlators/mgmt/glusterd/src/glusterd-rpc-ops.c
@@ -1632,7 +1632,7 @@ glusterd3_1_brick_op_cbk (struct rpc_req *req, struct iovec *iov,
gf_log ("", GF_LOG_ERROR, "error");
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
- rsp.op_errstr = "error";
+ rsp.op_errstr = strdup ("Unable to decode response");
event_type = GD_OP_EVENT_RCVD_RJT;
goto out;
}
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c
index 3d4389964..1c1873a6e 100644
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
@@ -444,11 +444,10 @@ glusterd_submit_reply (rpcsvc_request_t *req, void *arg,
iob = glusterd_serialize_reply (req, arg, sfunc, &rsp);
if (!iob) {
gf_log ("", GF_LOG_ERROR, "Failed to serialize reply");
- goto out;
+ } else {
+ iobref_add (iobref, iob);
}
- iobref_add (iobref, iob);
-
ret = rpcsvc_submit_generic (req, &rsp, 1, payload, payloadcount,
iobref);
@@ -456,7 +455,6 @@ glusterd_submit_reply (rpcsvc_request_t *req, void *arg,
* we can safely unref the iob in the hope that RPC layer must have
* ref'ed the iob on receiving into the txlist.
*/
- iobuf_unref (iob);
if (ret == -1) {
gf_log ("", GF_LOG_ERROR, "Reply submission failed");
goto out;
@@ -469,6 +467,8 @@ out:
iobref_unref (iobref);
}
+ if (iob)
+ iobuf_unref (iob);
return ret;
}