diff options
author | Krutika Dhananjay <kdhananj@redhat.com> | 2016-06-07 17:15:56 +0530 |
---|---|---|
committer | Atin Mukherjee <amukherj@redhat.com> | 2016-06-09 22:05:46 -0700 |
commit | 79dfe7d197ced45bd3b84f71d5c889e95f4dec1a (patch) | |
tree | 5af6a4aaa87a022eabcc9201dce9eba766ae7dbb /xlators/protocol/server/src/server-resolve.c | |
parent | 3bd4b1529817d4ce40c2b9654044e6230cbf7233 (diff) |
libglusterfs: Negate all but O_DIRECT flag if present on anon fds
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: I9e5206a6ce2b1b70df61ff23b1c961cf25bf7ff9
BUG: 1342171
Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com>
Reviewed-on: http://review.gluster.org/14665
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
CentOS-regression: Gluster Build System <jenkins@build.gluster.com>
Smoke: Gluster Build System <jenkins@build.gluster.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
Diffstat (limited to 'xlators/protocol/server/src/server-resolve.c')
-rw-r--r-- | xlators/protocol/server/src/server-resolve.c | 5 |
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 3e1411250b8..1ad45394dd7 100644 --- a/xlators/protocol/server/src/server-resolve.c +++ b/xlators/protocol/server/src/server-resolve.c @@ -453,7 +453,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); out: if (inode) inode_unref (inode); |