aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/kern/vfs_vnops.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c
index 019aefead0b3..fc5118e8aa24 100644
--- a/sys/kern/vfs_vnops.c
+++ b/sys/kern/vfs_vnops.c
@@ -1123,11 +1123,12 @@ vn_write(struct file *fp, struct uio *uio, struct ucred *active_cred, int flags,
ioflag |= IO_NDELAY;
if (fp->f_flag & O_DIRECT)
ioflag |= IO_DIRECT;
- if (fp->f_flag & O_FSYNC) {
- mp = atomic_load_ptr(&vp->v_mount);
- if (mp != NULL && mp->mnt_flag & MNT_SYNCHRONOUS)
- ioflag |= IO_SYNC;
- }
+
+ mp = atomic_load_ptr(&vp->v_mount);
+ if ((fp->f_flag & O_FSYNC) ||
+ (mp != NULL && (mp->mnt_flag & MNT_SYNCHRONOUS)))
+ ioflag |= IO_SYNC;
+
/*
* For O_DSYNC we set both IO_SYNC and IO_DATASYNC, so that VOP_WRITE()
* implementations that don't understand IO_DATASYNC fall back to full