summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorKrutika Dhananjay <kdhananj@redhat.com>2015-12-08 12:47:42 +0530
committerVijay Bellur <vbellur@redhat.com>2015-12-08 13:46:42 -0800
commit5fa88405ba1aba2312902255282fc4f6625d18ed (patch)
treef6497362bc7b87e5d9a4d9b7d8c7899fb6d878b8 /xlators
parent72334e2209b8b506f00d5d851bfb5fdc3eb38cf4 (diff)
features/shard: Do not update inode-ctx size (again) after xattrop
This is to fix race between parallel writevs that could mess up the file size value in inode ctx. Thanks to Pranith for helping with RCA'ing the issue. Change-Id: Ief94e0b3bcd87a8e2391fb39af1b99d020abd764 BUG: 1289447 Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com> Reviewed-on: http://review.gluster.org/12907 Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> Tested-by: NetBSD Build System <jenkins@build.gluster.org> Tested-by: Gluster Build System <jenkins@build.gluster.com>
Diffstat (limited to 'xlators')
-rw-r--r--xlators/features/shard/src/shard.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/xlators/features/shard/src/shard.c b/xlators/features/shard/src/shard.c
index 60b49d56180..b641f182fdb 100644
--- a/xlators/features/shard/src/shard.c
+++ b/xlators/features/shard/src/shard.c
@@ -573,8 +573,9 @@ shard_update_file_size_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
goto err;
}
- shard_inode_ctx_set (inode, this, &local->postbuf, 0,
- SHARD_INODE_WRITE_MASK);
+ if (local->fop == GF_FOP_FTRUNCATE || local->fop == GF_FOP_TRUNCATE)
+ shard_inode_ctx_set (inode, this, &local->postbuf, 0,
+ SHARD_INODE_WRITE_MASK);
err:
local->post_update_size_handler (frame, this);
@@ -3389,6 +3390,7 @@ __shard_get_delta_size_from_inode_ctx (shard_local_t *local, inode_t *inode,
} else {
local->delta_size = 0;
}
+ local->postbuf = ctx->stat;
return 0;
}