summaryrefslogtreecommitdiffstats
path: root/xlators/features/barrier/src
diff options
context:
space:
mode:
authorAtin Mukherjee <amukherj@redhat.com>2014-05-01 17:42:19 +0530
committerVijay Bellur <vbellur@redhat.com>2014-05-03 07:29:05 -0700
commit03c9c5db7259ea83161b2bd841f93c9f0688106e (patch)
tree3f57c942c27d62af18933dcb48f798c3951b0a29 /xlators/features/barrier/src
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 <amukherj@redhat.com> Reviewed-on: http://review.gluster.org/7633 Reviewed-by: Santosh Pradhan <spradhan@redhat.com> Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'xlators/features/barrier/src')
-rw-r--r--xlators/features/barrier/src/barrier.c2
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))) {
STACK_WIND_TAIL (frame, FIRST_CHILD(this),
FIRST_CHILD(this)->fops->writev,
fd, vector, count, off, flags, iobref, xdata);