14f8ab
From 4c2aa7adef3df500043dd45614d20c9987e6c0d9 Mon Sep 17 00:00:00 2001
14f8ab
From: Pranith Kumar K <pkarampu@redhat.com>
14f8ab
Date: Fri, 2 Aug 2019 12:05:09 +0530
14f8ab
Subject: [PATCH 274/276] cluster/ec: Update lock->good_mask on parent fop
14f8ab
 failure
14f8ab
14f8ab
When discard/truncate performs write fop, it should do so
14f8ab
after updating lock->good_mask to make sure readv happens
14f8ab
on the correct mask
14f8ab
14f8ab
Upstream-patch: https://review.gluster.org/c/glusterfs/+/23147
14f8ab
fixes: bz#1730914
14f8ab
Change-Id: Idfef0bbcca8860d53707094722e6ba3f81c583b7
14f8ab
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
14f8ab
Reviewed-on: https://code.engineering.redhat.com/gerrit/177978
14f8ab
Tested-by: RHGS Build Bot <nigelb@redhat.com>
14f8ab
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
14f8ab
---
14f8ab
 xlators/cluster/ec/src/ec-common.h      | 2 ++
14f8ab
 xlators/cluster/ec/src/ec-inode-write.c | 2 ++
14f8ab
 2 files changed, 4 insertions(+)
14f8ab
14f8ab
diff --git a/xlators/cluster/ec/src/ec-common.h b/xlators/cluster/ec/src/ec-common.h
14f8ab
index e948342..3c69471 100644
14f8ab
--- a/xlators/cluster/ec/src/ec-common.h
14f8ab
+++ b/xlators/cluster/ec/src/ec-common.h
14f8ab
@@ -204,4 +204,6 @@ void
14f8ab
 ec_reset_entry_healing(ec_fop_data_t *fop);
14f8ab
 char *
14f8ab
 ec_msg_str(ec_fop_data_t *fop);
14f8ab
+void
14f8ab
+ec_lock_update_good(ec_lock_t *lock, ec_fop_data_t *fop);
14f8ab
 #endif /* __EC_COMMON_H__ */
14f8ab
diff --git a/xlators/cluster/ec/src/ec-inode-write.c b/xlators/cluster/ec/src/ec-inode-write.c
14f8ab
index 2f28e11..8bfa3b4 100644
14f8ab
--- a/xlators/cluster/ec/src/ec-inode-write.c
14f8ab
+++ b/xlators/cluster/ec/src/ec-inode-write.c
14f8ab
@@ -89,6 +89,8 @@ ec_update_write(ec_fop_data_t *fop, uintptr_t mask, off_t offset, uint64_t size)
14f8ab
         goto out;
14f8ab
     }
14f8ab
 
14f8ab
+    if (fop->locks[0].lock)
14f8ab
+        ec_lock_update_good(fop->locks[0].lock, fop);
14f8ab
     vector.iov_base = iobuf->ptr;
14f8ab
     vector.iov_len = size;
14f8ab
     memset(vector.iov_base, 0, vector.iov_len);
14f8ab
-- 
14f8ab
1.8.3.1
14f8ab