summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/afr/src/afr-common.c
diff options
context:
space:
mode:
authorlinbaiye <linbaiye@gmail.com>2012-09-28 18:56:26 +0800
committerAnand Avati <avati@redhat.com>2012-10-11 20:59:45 -0700
commit5459e74ef28bd08e48f95c2732f04144fdbbee56 (patch)
treee4dd506813c344e59adf47765d2376cbd9d8df9e /xlators/cluster/afr/src/afr-common.c
parent7413b50220779d185efdb1d259c379a119a30a77 (diff)
Preventing client crashing as the callings of GF_CALLOC has been failed.
As the callings of GF_CALLOC can seldom come to a failure, glusterfs client will crash due to segment fault. We should have returned once the variables of transaction's local can't be alloced. Change-Id: Ia3798b8349d832b23c7825e64dbad93ebe29cd1b BUG: 861335 Signed-off-by: linbaiye <linbaiye@gmail.com> Reviewed-on: http://review.gluster.org/4005 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'xlators/cluster/afr/src/afr-common.c')
-rw-r--r--xlators/cluster/afr/src/afr-common.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/xlators/cluster/afr/src/afr-common.c b/xlators/cluster/afr/src/afr-common.c
index 4130adc6f17..21272c0d728 100644
--- a/xlators/cluster/afr/src/afr-common.c
+++ b/xlators/cluster/afr/src/afr-common.c
@@ -2618,8 +2618,11 @@ afr_flush (call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *xdata)
op_errno = -ret;
goto out;
}
- afr_transaction (transaction_frame, this, AFR_DATA_TRANSACTION);
-
+ ret = afr_transaction (transaction_frame, this, AFR_DATA_TRANSACTION);
+ if (ret < 0) {
+ op_errno = -ret;
+ goto out;
+ }
ret = 0;
out: