From 11b0ea3d79445e3773d450132121387b67d7bc9a Mon Sep 17 00:00:00 2001 From: Atin Mukherjee Date: Wed, 23 Apr 2014 17:21:41 +0530 Subject: barrier : barrier O_SYNC write incorrect flag check barrier_writev function was doing the following check to determine whether its a O_SYNC write or not: if (!(flags & O_SYNC)) The problem here is this flag is not fd's flag and gfapi write does not copy open call fd's flag into write flag because of which O_SYNC writes were not getting barriered even if barrier was enabled. The check has been modified as: if (!(fd->flags & (O_SYNC | O_DSYNC))) Change-Id: I07b23852d150b81c7317100ca6d22d082ad897cd BUG: 1090488 Signed-off-by: Atin Mukherjee Reviewed-on: http://review.gluster.org/7549 Reviewed-by: Varun Shastry Reviewed-by: Santosh Pradhan Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- xlators/features/barrier/src/barrier.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xlators/features/barrier/src/barrier.c b/xlators/features/barrier/src/barrier.c index 5edb9cdd392..5b48184d4c7 100644 --- a/xlators/features/barrier/src/barrier.c +++ b/xlators/features/barrier/src/barrier.c @@ -125,7 +125,7 @@ barrier_writev (call_frame_t *frame, xlator_t *this, fd_t *fd, struct iovec *vector, int32_t count, off_t off, uint32_t flags, struct iobref *iobref, dict_t *xdata) { - if (!(flags & O_SYNC)) { + if (!(fd->flags & (O_SYNC | O_DSYNC))) { STACK_WIND_TAIL (frame, FIRST_CHILD(this), FIRST_CHILD(this)->fops->writev, fd, vector, count, off, flags, iobref, xdata); -- cgit