74b1de
From 40bd6e9c186adb427e136a84eaab631e6a6f5263 Mon Sep 17 00:00:00 2001
74b1de
From: Pranith Kumar K <pkarampu@redhat.com>
74b1de
Date: Sun, 5 May 2019 21:17:24 +0530
74b1de
Subject: [PATCH 140/141] cluster/ec: Reopen shouldn't happen with O_TRUNC
74b1de
74b1de
Problem:
74b1de
Doing re-open with O_TRUNC will truncate the fragment even when it is not
74b1de
needed needing extra heals
74b1de
74b1de
Fix:
74b1de
At the time of re-open don't use O_TRUNC.
74b1de
74b1de
Upstream-patch: https://review.gluster.org/c/glusterfs/+/22660/
74b1de
74b1de
fixes bz#1706549
74b1de
Change-Id: Idc6408968efaad897b95a5a52481c66e843d3fb8
74b1de
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
74b1de
Reviewed-on: https://code.engineering.redhat.com/gerrit/169982
74b1de
Tested-by: RHGS Build Bot <nigelb@redhat.com>
74b1de
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
74b1de
---
74b1de
 xlators/cluster/ec/src/ec-common.c | 2 +-
74b1de
 1 file changed, 1 insertion(+), 1 deletion(-)
74b1de
74b1de
diff --git a/xlators/cluster/ec/src/ec-common.c b/xlators/cluster/ec/src/ec-common.c
74b1de
index 1454ae2..b1ba5e9 100644
74b1de
--- a/xlators/cluster/ec/src/ec-common.c
74b1de
+++ b/xlators/cluster/ec/src/ec-common.c
74b1de
@@ -128,7 +128,7 @@ ec_fix_open(ec_fop_data_t *fop, uintptr_t mask)
74b1de
     } else {
74b1de
         ec_open(fop->frame, fop->xl, need_open,
74b1de
                 EC_MINIMUM_ONE | EC_FOP_NO_PROPAGATE_ERROR, NULL, NULL, &loc,
74b1de
-                fop->fd->flags, fop->fd, NULL);
74b1de
+                fop->fd->flags & (~O_TRUNC), fop->fd, NULL);
74b1de
     }
74b1de
 
74b1de
 out:
74b1de
-- 
74b1de
1.8.3.1
74b1de