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