summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaghavendra G <raghavendra@gluster.com>2009-08-08 12:11:15 +0000
committerAnand V. Avati <avati@dev.gluster.com>2009-08-17 14:37:58 -0700
commiteb25bfe02562b229600a1c23149868432992cf2f (patch)
tree7025d050089e69d4b14ff7ce5959a27d26f2b599
parentc2caeffbc6e1a3b9cb43237ecac105008561e8d6 (diff)
write-behind: use O_ACCMODE while checking for O_RDONLY in flags.
Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 196 (write-behind window size getting set to 0.) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=196
-rw-r--r--xlators/performance/write-behind/src/write-behind.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/xlators/performance/write-behind/src/write-behind.c b/xlators/performance/write-behind/src/write-behind.c
index f641295ad..569450a9f 100644
--- a/xlators/performance/write-behind/src/write-behind.c
+++ b/xlators/performance/write-behind/src/write-behind.c
@@ -916,7 +916,7 @@ wb_open_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret,
if (frame->local) {
flags = (long)frame->local;
if (((flags & O_DIRECT) == O_DIRECT)
- || ((flags & O_RDONLY) == O_RDONLY)
+ || ((flags & O_ACCMODE) == O_RDONLY)
|| (((flags & O_SYNC) == O_SYNC)
&& (conf->enable_O_SYNC == _gf_true))) {
file->window_size = 0;
@@ -971,7 +971,7 @@ wb_create_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
if (frame->local) {
flags = (long)frame->local;
if (((flags & O_DIRECT) == O_DIRECT)
- || ((flags & O_RDONLY) == O_RDONLY)
+ || ((flags & O_ACCMODE) == O_RDONLY)
|| (((flags & O_SYNC) == O_SYNC)
&& (conf->enable_O_SYNC == _gf_true))) {
file->window_size = 0;