summaryrefslogtreecommitdiffstats
path: root/xlators/features/shard/src
diff options
context:
space:
mode:
authorKrutika Dhananjay <kdhananj@redhat.com>2015-12-08 12:47:42 +0530
committerPranith Kumar Karampuri <pkarampu@redhat.com>2015-12-08 22:15:59 -0800
commit2142614f385352903d0cdb67657f2e639b79f72c (patch)
tree60fef0be1acbb145807711e4ce5ed2637dd840be /xlators/features/shard/src
parentdf38146d698b5acbf51d983766322cc0cb10b47b (diff)
features/shard: Do not update inode-ctx size (again) after xattrop
Backport of: http://review.gluster.org/#/c/12907/ 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: I8e26d92568434bc6c60b0c23089532bf3bdac509 BUG: 1289570 Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com> Reviewed-on: http://review.gluster.org/12911 Tested-by: NetBSD Build System <jenkins@build.gluster.org> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Diffstat (limited to 'xlators/features/shard/src')
-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;
}