summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/afr/src/afr-inode-write.c
diff options
context:
space:
mode:
authorAnuradha Talur <atalur@redhat.com>2015-09-11 18:43:36 +0530
committerPranith Kumar Karampuri <pkarampu@redhat.com>2015-09-14 02:56:53 -0700
commitfa08597a004b591afbeb478d0a736ec09066f648 (patch)
tree855b85e44331fc9585fb19e1291faa836248dc4c /xlators/cluster/afr/src/afr-inode-write.c
parent2e041639d8e49e2b768dd43c6f702106250e4da9 (diff)
afr : get split-brain-status in a synctask
On executing `getfattr -n replica.split-brain-status <file>` on mount, there is a possibility that the mount hangs. To avoid this hang, fetch the split-brain-status of a file in synctask. Change-Id: I87b781419ffc63248f915325b845e3233143d385 BUG: 1262345 Signed-off-by: Anuradha Talur <atalur@redhat.com> Reviewed-on: http://review.gluster.org/12163 Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> Tested-by: NetBSD Build System <jenkins@build.gluster.org> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Ravishankar N <ravishankar@redhat.com>
Diffstat (limited to 'xlators/cluster/afr/src/afr-inode-write.c')
-rw-r--r--xlators/cluster/afr/src/afr-inode-write.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/xlators/cluster/afr/src/afr-inode-write.c b/xlators/cluster/afr/src/afr-inode-write.c
index 0601b89090c..44ac01ade5a 100644
--- a/xlators/cluster/afr/src/afr-inode-write.c
+++ b/xlators/cluster/afr/src/afr-inode-write.c
@@ -1337,6 +1337,7 @@ afr_handle_split_brain_commands (xlator_t *this, call_frame_t *frame,
" synctask. Aborting split-brain choice set"
" for %s", loc->name);
ret = 1;
+ op_errno = ENOMEM;
goto out;
}
ret = 0;
@@ -1360,6 +1361,8 @@ out:
/* key was correct but value was invalid when ret == 1 */
if (ret == 1) {
AFR_STACK_UNWIND (setxattr, frame, -1, op_errno, NULL);
+ if (data)
+ GF_FREE (data);
ret = 0;
}
return ret;