diff options
authorAtin Mukherjee <>2014-05-01 17:42:19 +0530
committerVijay Bellur <>2014-05-03 07:29:05 -0700
commit03c9c5db7259ea83161b2bd841f93c9f0688106e (patch)
parent11b0ea3d79445e3773d450132121387b67d7bc9a (diff)
barrier : fsync call over NFS should be barriered when barrier is enabled
barrier_fsync was not getting hit when fsync call is issued from the application over NFS mount. Investigation reveals that NFS doesn't send an explicit fsync call to the glusterfs server, however NFS converts it with a stable write with O_DSYNC flag, so for a fsync call over NFS mount point, barrier feature always needs to check for writev and its correspoding flags. So to meet all the coditions of write with O_SYNC and fsync getting blocked when barrier is enabled the check has been modified with following: if (!((flags | fd->flags) & (O_SYNC | O_DSYNC))) Point to be noted here is we need to check both fd's flag and the explicit flag as for NFS write fd->flags is 0. Bug ID : 1091902 Change-Id: Ifd5377fca2cc93bb72158dd525b2aab8b4164ca8 Signed-off-by: Atin Mukherjee <> Reviewed-on: Reviewed-by: Santosh Pradhan <> Reviewed-by: Krishnan Parthasarathi <> Tested-by: Gluster Build System <> Reviewed-by: Vijay Bellur <>
1 files changed, 1 insertions, 1 deletions
diff --git a/xlators/features/barrier/src/barrier.c b/xlators/features/barrier/src/barrier.c
index 5b48184d4c7..a6867f6f45f 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 (!(fd->flags & (O_SYNC | O_DSYNC))) {
+ if (!((flags | fd->flags) & (O_SYNC | O_DSYNC))) {
fd, vector, count, off, flags, iobref, xdata);