diff options
author | Trond Myklebust <trond.myklebust@primarydata.com> | 2018-01-28 09:29:41 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-02-17 13:21:14 +0100 |
commit | b79d8854ee0e222c5beb52fc50246ad0b6d9088e (patch) | |
tree | b07cb5af096953372b712976bb9b06d84c6435bf | |
parent | 967f650f8835012e9d8bf96bdace29a6b84b43db (diff) |
NFS: Fix a race between mmap() and O_DIRECT
commit e231c6879cfd44e4fffd384bb6dd7d313249a523 upstream.
When locking the file in order to do O_DIRECT on it, we must unmap
any mmapped ranges on the pagecache so that we can flush out the
dirty data.
Fixes: a5864c999de67 ("NFS: Do not serialise O_DIRECT reads and writes")
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | fs/nfs/io.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/nfs/io.c b/fs/nfs/io.c index 1fc5d1ce327e..d18ccc1ce0b5 100644 --- a/fs/nfs/io.c +++ b/fs/nfs/io.c @@ -98,7 +98,7 @@ static void nfs_block_buffered(struct nfs_inode *nfsi, struct inode *inode) { if (!test_bit(NFS_INO_ODIRECT, &nfsi->flags)) { set_bit(NFS_INO_ODIRECT, &nfsi->flags); - nfs_wb_all(inode); + nfs_sync_mapping(inode->i_mapping); } } |