summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/afr/src/afr-self-heal-metadata.c
diff options
context:
space:
mode:
authorPranith Kumar K <pkarampu@redhat.com>2017-09-04 16:57:25 +0530
committerjiffin tony Thottan <jthottan@redhat.com>2018-03-08 06:39:57 +0000
commite304d218602f3099dc4ba9bb86fd953cee8a8e59 (patch)
tree24fc0ac1a189952ee003ea54156a24f794fc606e /xlators/cluster/afr/src/afr-self-heal-metadata.c
parentafcb83f6eb11bc5b7a0e6c5c0b7c8f56af871840 (diff)
cluster/afr: Fail open on split-brain
Problem: Append on a file with split-brain succeeds. Open is intercepted by open-behind, when write comes on the file, open-behind does open+write. Open succeeds because afr doesn't fail it. Then write succeeds because write-behind intercepts it. Flush is also intercepted by write-behind, so the application never gets to know that the write failed. Fix: Fail open on split-brain, so that when open-behind does open+write open fails which leads to write failure. Application will know about this failure. Change-Id: I4bff1c747c97bb2925d6987f4ced5f1ce75dbc15 BUG: 1544635 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> (cherry picked from commit 786343abca3474ff01aa1017210112d97cbc4843)
Diffstat (limited to 'xlators/cluster/afr/src/afr-self-heal-metadata.c')
-rw-r--r--xlators/cluster/afr/src/afr-self-heal-metadata.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/xlators/cluster/afr/src/afr-self-heal-metadata.c b/xlators/cluster/afr/src/afr-self-heal-metadata.c
index f23cf8ec6ee..199f8961480 100644
--- a/xlators/cluster/afr/src/afr-self-heal-metadata.c
+++ b/xlators/cluster/afr/src/afr-self-heal-metadata.c
@@ -486,9 +486,9 @@ afr_selfheal_metadata_by_stbuf (xlator_t *this, struct iatt *stbuf)
goto out;
}
- frame = afr_frame_create (this);
+ frame = afr_frame_create (this, &ret);
if (!frame) {
- ret = -ENOMEM;
+ ret = -ret;
goto out;
}