summaryrefslogtreecommitdiff
path: root/fs/afs
diff options
context:
space:
mode:
Diffstat (limited to 'fs/afs')
-rw-r--r--fs/afs/write.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/afs/write.c b/fs/afs/write.c
index c63a3c8beb73..6be1bc31616a 100644
--- a/fs/afs/write.c
+++ b/fs/afs/write.c
@@ -692,8 +692,9 @@ ssize_t afs_file_write(struct kiocb *iocb, const struct iovec *iov,
}
/* return error values for O_SYNC and IS_SYNC() */
- if (IS_SYNC(&vnode->vfs_inode) || iocb->ki_filp->f_flags & O_SYNC) {
- ret = afs_fsync(iocb->ki_filp, dentry, 1);
+ if (IS_SYNC(&vnode->vfs_inode) || iocb->ki_filp->f_flags & O_DSYNC) {
+ ret = afs_fsync(iocb->ki_filp, dentry,
+ (iocb->ki_filp->f_flags & __O_SYNC) ? 0 : 1);
if (ret < 0)
result = ret;
}