summaryrefslogtreecommitdiffstats
path: root/fs/nfs
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@primarydata.com>2018-01-28 09:29:41 -0500
committerTrond Myklebust <trond.myklebust@primarydata.com>2018-01-28 22:00:15 -0500
commite231c6879cfd44e4fffd384bb6dd7d313249a523 (patch)
tree7894f5ccb7813ba0cd1f1717443255af510b417d /fs/nfs
parent128159f2929ef398698c28a4177eca1c1b88aa74 (diff)
downloadlinux-stable-e231c6879cfd44e4fffd384bb6dd7d313249a523.tar.gz
linux-stable-e231c6879cfd44e4fffd384bb6dd7d313249a523.tar.bz2
linux-stable-e231c6879cfd44e4fffd384bb6dd7d313249a523.zip
NFS: Fix a race between mmap() and O_DIRECT
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> Cc: stable@vger.kernel.org # v4.8+
Diffstat (limited to 'fs/nfs')
-rw-r--r--fs/nfs/io.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/nfs/io.c b/fs/nfs/io.c
index 20fef85d2bb1..9034b4926909 100644
--- a/fs/nfs/io.c
+++ b/fs/nfs/io.c
@@ -99,7 +99,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);
}
}