1
0
Fork 0

NFS: Fix a race between mmap() and O_DIRECT

commit e231c6879c 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: a5864c999d ("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>
steinar/wifi_calib_4_9_kernel
Trond Myklebust 2018-01-28 09:29:41 -05:00 committed by Greg Kroah-Hartman
parent 967f650f88
commit b79d8854ee
1 changed files with 1 additions and 1 deletions

View File

@ -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);
}
}