From ecc844dc15fffacaf37916e4570e520534f2545c Mon Sep 17 00:00:00 2001 From: Raghavendra G Date: Tue, 7 Jul 2009 02:33:15 +0000 Subject: write-behind: Use O_ACCMODE while checking for access modes. Signed-off-by: Anand V. Avati --- xlators/performance/write-behind/src/write-behind.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'xlators/performance/write-behind/src/write-behind.c') diff --git a/xlators/performance/write-behind/src/write-behind.c b/xlators/performance/write-behind/src/write-behind.c index ebf6be062de..26981d4d8aa 100644 --- a/xlators/performance/write-behind/src/write-behind.c +++ b/xlators/performance/write-behind/src/write-behind.c @@ -1127,7 +1127,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; @@ -1186,7 +1186,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; -- cgit