diff options
author | Trond Myklebust <trond.myklebust@primarydata.com> | 2015-02-27 22:54:19 -0500 |
---|---|---|
committer | Trond Myklebust <trond.myklebust@primarydata.com> | 2015-03-01 23:22:40 -0500 |
commit | aa5accea404b2b92d39c1924cfeb90f6082f6389 (patch) | |
tree | 994520d462eaa508313e23750c992e48a0dba08e /fs | |
parent | be36e185bd26388355d3ea1847278b96ab350792 (diff) |
NFS: Ensure that buffered writes wait for O_DIRECT writes to complete
The O_DIRECT code will grab the inode->i_mutex and flush out buffered
writes, before scheduling a read or a write. However there is no
equivalent in the buffered write code to wait for O_DIRECT to complete.
Fixes a reported issue in xfstests generic/133, when first performing an
O_DIRECT write followed by a buffered write.
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Tested-by: Chuck Lever <chuck.lever@oracle.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/nfs/file.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/nfs/file.c b/fs/nfs/file.c index 94712fc781fa..c045c7169fa0 100644 --- a/fs/nfs/file.c +++ b/fs/nfs/file.c | |||
@@ -372,6 +372,10 @@ start: | |||
372 | nfs_wait_bit_killable, TASK_KILLABLE); | 372 | nfs_wait_bit_killable, TASK_KILLABLE); |
373 | if (ret) | 373 | if (ret) |
374 | return ret; | 374 | return ret; |
375 | /* | ||
376 | * Wait for O_DIRECT to complete | ||
377 | */ | ||
378 | nfs_inode_dio_wait(mapping->host); | ||
375 | 379 | ||
376 | page = grab_cache_page_write_begin(mapping, index, flags); | 380 | page = grab_cache_page_write_begin(mapping, index, flags); |
377 | if (!page) | 381 | if (!page) |