summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorSunil Kumar Acharya <sheggodu@redhat.com>2017-11-22 15:12:26 +0530
committerShyamsundar Ranganathan <srangana@redhat.com>2017-11-29 14:43:10 +0000
commit098a5ec1a30f69ec1bbea89f14b4a7a9212d5e20 (patch)
tree6589adf4c35725f3071f58ed2ab66507431fc8b9 /xlators
parent4e33ea6e469f8812813f5616dee2e9628e2fc474 (diff)
cluster/ec: EC DISCARD doesn't punch hole properly
Problem: DISCARD operation on EC volume was punching hole of lesser size than the specified size in some cases. Solution: EC was not handling punch hole for tail part in some cases. Updated the code to handle it appropriately. >BUG: 1516206 >Change-Id: If3e69e417c3e5034afee04e78f5f78855e65f932 >Signed-off-by: Sunil Kumar Acharya <sheggodu@redhat.com> BUG: 1518257 Change-Id: If3e69e417c3e5034afee04e78f5f78855e65f932 Signed-off-by: Sunil Kumar Acharya <sheggodu@redhat.com>
Diffstat (limited to 'xlators')
-rw-r--r--xlators/cluster/ec/src/ec-inode-write.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/xlators/cluster/ec/src/ec-inode-write.c b/xlators/cluster/ec/src/ec-inode-write.c
index ae51202..2c1165b 100644
--- a/xlators/cluster/ec/src/ec-inode-write.c
+++ b/xlators/cluster/ec/src/ec-inode-write.c
@@ -1144,11 +1144,13 @@ void ec_update_discard_write(ec_fop_data_t *fop, uintptr_t mask)
error = ec_update_write (fop, mask, off_head, fop->user_size);
} else {
size_head = fop->int32;
- size_tail = (fop->user_size - fop->int32) % ec->stripe_size;
+ size_tail = (off_head + fop->user_size) % ec->stripe_size;
off_tail = off_head + fop->user_size - size_tail;
if (size_head) {
error = ec_update_write (fop, mask, off_head, size_head);
- goto out;
+ if (error) {
+ goto out;
+ }
}
if (size_tail) {
error = ec_update_write (fop, mask, off_tail, size_tail);