summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-mgmt-handler.c
diff options
context:
space:
mode:
authorAvra Sengupta <asengupt@redhat.com>2015-05-05 10:58:10 +0530
committerKrishnan Parthasarathi <kparthas@redhat.com>2015-05-28 19:38:05 -0700
commit4397d7e72fdff6f01c59b72eebea421f23c1a392 (patch)
tree8c09329c2fbccaf5cb8a4c80ed8323a670ef0aa1 /xlators/mgmt/glusterd/src/glusterd-mgmt-handler.c
parente6934debda3a67b5666f1aa30b33c5267de49d84 (diff)
glusterd/snapshot: Return correct errno in events of failure - PATCH 1
RETCODE ERROR ------------------------------------------- 30800 Internal Error 30801 Another Transaction In Progress Change-Id: Ica7fd2e513b2c28717b6df73cfb2667725dbf057 BUG: 1212413 Signed-off-by: Avra Sengupta <asengupt@redhat.com> Reviewed-on: http://review.gluster.org/10313 Reviewed-by: Rajesh Joseph <rjoseph@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Tested-by: NetBSD Build System Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-mgmt-handler.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-mgmt-handler.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-mgmt-handler.c b/xlators/mgmt/glusterd/src/glusterd-mgmt-handler.c
index db5a19bf675..9ebaf00d32f 100644
--- a/xlators/mgmt/glusterd/src/glusterd-mgmt-handler.c
+++ b/xlators/mgmt/glusterd/src/glusterd-mgmt-handler.c
@@ -28,7 +28,8 @@ glusterd_mgmt_v3_null (rpcsvc_request_t *req)
}
static int
-glusterd_mgmt_v3_lock_send_resp (rpcsvc_request_t *req, int32_t status)
+glusterd_mgmt_v3_lock_send_resp (rpcsvc_request_t *req, int32_t status,
+ uint32_t op_errno)
{
gd1_mgmt_v3_lock_rsp rsp = {{0},};
@@ -41,7 +42,7 @@ glusterd_mgmt_v3_lock_send_resp (rpcsvc_request_t *req, int32_t status)
rsp.op_ret = status;
if (rsp.op_ret)
- rsp.op_errno = errno;
+ rsp.op_errno = op_errno;
glusterd_get_uuid (&rsp.uuid);
@@ -61,6 +62,7 @@ glusterd_synctasked_mgmt_v3_lock (rpcsvc_request_t *req,
{
int32_t ret = -1;
xlator_t *this = NULL;
+ uint32_t op_errno = 0;
this = THIS;
GF_ASSERT (this);
@@ -69,14 +71,14 @@ glusterd_synctasked_mgmt_v3_lock (rpcsvc_request_t *req,
GF_ASSERT (ctx->dict);
/* Trying to acquire multiple mgmt_v3 locks */
- ret = glusterd_multiple_mgmt_v3_lock (ctx->dict, ctx->uuid);
+ ret = glusterd_multiple_mgmt_v3_lock (ctx->dict, ctx->uuid, &op_errno);
if (ret)
gf_msg (this->name, GF_LOG_ERROR, 0,
GD_MSG_MGMTV3_LOCK_GET_FAIL,
"Failed to acquire mgmt_v3 locks for %s",
uuid_utoa (ctx->uuid));
- ret = glusterd_mgmt_v3_lock_send_resp (req, ret);
+ ret = glusterd_mgmt_v3_lock_send_resp (req, ret, op_errno);
gf_msg_trace (this->name, 0, "Returning %d", ret);
return ret;