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