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