summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-syncop.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-syncop.c b/xlators/mgmt/glusterd/src/glusterd-syncop.c
index c975d01f1b2..c9a1b5a7561 100644
--- a/xlators/mgmt/glusterd/src/glusterd-syncop.c
+++ b/xlators/mgmt/glusterd/src/glusterd-syncop.c
@@ -1099,9 +1099,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;
}