path: root/xlators
diff options
authorKrutika Dhananjay <>2016-06-07 17:15:56 +0530
committerPranith Kumar Karampuri <>2016-06-16 17:21:20 -0700
commit0fea541b0b217fc3c76e6a36577b99be71e32d56 (patch)
tree0fc4e96e4436f876d00b285a6f3a5985d28f534f /xlators
parent9af36b95976d4e54859c9b60bd2e711518b3be6e (diff)
libglusterfs: Negate all but O_DIRECT flag if present on anon fds
Backport of: This is to prevent any unforeseen problems that might arise due to writevs and readvs being wound with @flag parameter containing O_TRUNC or O_APPEND especially wrt translators like sharding and ec where O_TRUNC write or O_APPEND write on individual shards/fragments is not the same as O_TRUNC write or O_APPEND write as expected by the application. Change-Id: Ib0110731d6099bc888b7ada552a2abbea8e76051 BUG: 1342903 Signed-off-by: Krutika Dhananjay <> Reviewed-on: Smoke: Gluster Build System <> NetBSD-regression: NetBSD Build System <> Reviewed-by: Pranith Kumar Karampuri <> CentOS-regression: Gluster Build System <>
Diffstat (limited to 'xlators')
1 files changed, 4 insertions, 1 deletions
diff --git a/xlators/protocol/server/src/server-resolve.c b/xlators/protocol/server/src/server-resolve.c
index 4e6ec6a852a..d3e604fae2f 100644
--- a/xlators/protocol/server/src/server-resolve.c
+++ b/xlators/protocol/server/src/server-resolve.c
@@ -458,7 +458,10 @@ resolve_anonfd_simple (call_frame_t *frame)
ret = 0;
- state->fd = fd_anonymous_with_flags (inode, state->flags);
+ if (frame->root->op == GF_FOP_READ || frame->root->op == GF_FOP_WRITE)
+ state->fd = fd_anonymous_with_flags (inode, state->flags);
+ else
+ state->fd = fd_anonymous (inode);
if (inode)
inode_unref (inode);