diff options
author | Trond Myklebust <trond.myklebust@primarydata.com> | 2015-03-25 23:58:53 +0100 |
---|---|---|
committer | Trond Myklebust <trond.myklebust@primarydata.com> | 2015-03-27 17:39:37 +0100 |
commit | a0815d556d1cfb686b46995f86fb081f623fa720 (patch) | |
tree | fd6edd1d18bc1a6633a7e968089d089dd4aec6cd /fs/nfs/nfs4file.c | |
parent | NFSv4: Truncating file opens should also sync O_DIRECT writes (diff) | |
download | linux-a0815d556d1cfb686b46995f86fb081f623fa720.tar.xz linux-a0815d556d1cfb686b46995f86fb081f623fa720.zip |
NFSv4.1/pnfs: Ensure that writes respect the O_SYNC flag when doing O_DIRECT
If the caller does not specify the O_SYNC flag, then it is legitimate
to return from O_DIRECT without doing a pNFS layoutcommit operation.
However if the file is opened O_DIRECT|O_SYNC then we'd better get it
right.
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Diffstat (limited to 'fs/nfs/nfs4file.c')
-rw-r--r-- | fs/nfs/nfs4file.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/nfs/nfs4file.c b/fs/nfs/nfs4file.c index 8da5409e6f1a..befe7a2c6284 100644 --- a/fs/nfs/nfs4file.c +++ b/fs/nfs/nfs4file.c @@ -104,6 +104,7 @@ nfs4_file_fsync(struct file *file, loff_t start, loff_t end, int datasync) trace_nfs_fsync_enter(inode); + nfs_inode_dio_wait(inode); do { ret = filemap_write_and_wait_range(inode->i_mapping, start, end); if (ret != 0) |