summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKrutika Dhananjay <kdhananj@redhat.com>2014-02-01 22:49:22 +0530
committerVijay Bellur <vbellur@redhat.com>2014-02-07 19:00:19 -0800
commitef37b4b6a22fe04b5a1789c45b28c8d7e6fe764a (patch)
tree6a3f7c15f9ed3fe809e7ab0630ac303e2f968378
parent358b88087051d3b2534446c62f6bbac472e9198b (diff)
glusterd: Reset opinfo.op ONLY if lock succeeded
... and also initialise @this before doing anything else. Change-Id: I0244a7f61a826b32f4c2dfe51e246f2593a38211 BUG: 1060434 Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com> Reviewed-on: http://review.gluster.org/6885 Reviewed-by: Kaushal M <kaushal@redhat.com> Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-on: http://review.gluster.org/6922 Reviewed-by: Vijay Bellur <vbellur@redhat.com>
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-syncop.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-syncop.c b/xlators/mgmt/glusterd/src/glusterd-syncop.c
index c975d01..4319841 100644
--- a/xlators/mgmt/glusterd/src/glusterd-syncop.c
+++ b/xlators/mgmt/glusterd/src/glusterd-syncop.c
@@ -1067,6 +1067,8 @@ gd_unlock_op_phase (struct list_head *peers, glusterd_op_t op, int op_ret,
xlator_t *this = NULL;
struct syncargs args = {0};
+ this = THIS;
+
if (!npeers) {
ret = 0;
goto out;
@@ -1077,7 +1079,6 @@ gd_unlock_op_phase (struct list_head *peers, glusterd_op_t op, int op_ret,
if (!is_locked)
goto out;
- this = THIS;
synctask_barrier_init((&args));
peer_cnt = 0;
list_for_each_entry_safe (peerinfo, tmp, peers, op_peers_list) {
@@ -1099,9 +1100,11 @@ gd_unlock_op_phase (struct list_head *peers, glusterd_op_t op, int op_ret,
out:
glusterd_op_send_cli_response (op, op_ret, 0, req, op_ctx, op_errstr);
- glusterd_op_clear_op (op);
- if (is_locked)
+ /* Unlock and reset opinfo.op ONLY if lock ever succeeded! */
+ if (is_locked) {
+ glusterd_op_clear_op (op);
glusterd_unlock (MY_UUID);
+ }
return 0;
}