summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/ec/src/ec-inode-write.c
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/cluster/ec/src/ec-inode-write.c')
-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);