diff options
author | Avra Sengupta <asengupt@redhat.com> | 2015-05-05 10:58:10 +0530 |
---|---|---|
committer | Kaushal M <kaushal@redhat.com> | 2015-06-01 00:18:15 -0700 |
commit | e9a37d5a3471db02e1c7922cee93bf290e2f326d (patch) | |
tree | 8ebcebd20a6d00df8cf65cba448e64dc47e88f68 /xlators/mgmt/glusterd/src/glusterd-syncop.c | |
parent | de256912050bc3d41c6e5ea8b003cf50bd8c7399 (diff) |
glusterd/snapshot: Return correct errno in events of failure - PATCH 1
Backport of patch http://review.gluster.org/#/c/10313/
RETCODE ERROR
-------------------------------------------
30800 Internal Error
30801 Another Transaction In Progress
>Change-Id: Ica7fd2e513b2c28717b6df73cfb2667725dbf057
>BUG: 1226117
>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>
>(cherry picked from commit 4397d7e72fdff6f01c59b72eebea421f23c1a392)
Change-Id: Iace6ac0f150919cead94e6c5d99a23d28d45046e
BUG: 1226117
Signed-off-by: Avra Sengupta <asengupt@redhat.com>
Reviewed-on: http://review.gluster.org/11011
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Kaushal M <kaushal@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-syncop.c')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-syncop.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-syncop.c b/xlators/mgmt/glusterd/src/glusterd-syncop.c index 6f36478aeca..2ac947fd710 100644 --- a/xlators/mgmt/glusterd/src/glusterd-syncop.c +++ b/xlators/mgmt/glusterd/src/glusterd-syncop.c @@ -1692,6 +1692,7 @@ gd_sync_task_begin (dict_t *op_ctx, rpcsvc_request_t * req) gf_boolean_t is_global = _gf_false; uuid_t *txn_id = NULL; glusterd_op_info_t txn_opinfo = {{0},}; + uint32_t op_errno = 0; this = THIS; GF_ASSERT (this); @@ -1768,7 +1769,8 @@ gd_sync_task_begin (dict_t *op_ctx, rpcsvc_request_t * req) goto out; } - ret = glusterd_mgmt_v3_lock (volname, MY_UUID, "vol"); + ret = glusterd_mgmt_v3_lock (volname, MY_UUID, + &op_errno, "vol"); if (ret) { gf_log (this->name, GF_LOG_ERROR, "Unable to acquire lock for %s", volname); @@ -1782,7 +1784,8 @@ gd_sync_task_begin (dict_t *op_ctx, rpcsvc_request_t * req) global: if (is_global) { - ret = glusterd_mgmt_v3_lock (global, MY_UUID, "global"); + ret = glusterd_mgmt_v3_lock (global, MY_UUID, &op_errno, + "global"); if (ret) { gf_log (this->name, GF_LOG_ERROR, "Unable to acquire lock for %s", global); @@ -1856,7 +1859,11 @@ out: uuid_utoa (*txn_id)); } - glusterd_op_send_cli_response (op, op_ret, 0, req, op_ctx, op_errstr); + if (ret && (op_errno == 0)) + op_errno = -1; + + glusterd_op_send_cli_response (op, op_ret, op_errno, req, + op_ctx, op_errstr); if (volname) GF_FREE (volname); |