diff options
author | Ingo Molnar <mingo@kernel.org> | 2016-08-24 12:11:29 +0200 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2016-08-24 12:11:29 +0200 |
commit | eb4e841099f813c2df5fbb00ae4a9d315cb7c9dc (patch) | |
tree | 15c1f7e595cb3168035d111d628c919a61f3b14a /fs/xfs/xfs_file.c | |
parent | 556b6723689694ac9134bcc36a07828168e057f4 (diff) | |
parent | fa8410b355251fd30341662a40ac6b22d3e38468 (diff) |
Merge tag 'v4.8-rc3' into x86/asm, to pick up fixes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'fs/xfs/xfs_file.c')
-rw-r--r-- | fs/xfs/xfs_file.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c index ed95e5bb04e6..e612a0233710 100644 --- a/fs/xfs/xfs_file.c +++ b/fs/xfs/xfs_file.c @@ -741,9 +741,20 @@ xfs_file_dax_write( * page is inserted into the pagecache when we have to serve a write * fault on a hole. It should never be dirtied and can simply be * dropped from the pagecache once we get real data for the page. + * + * XXX: This is racy against mmap, and there's nothing we can do about + * it. dax_do_io() should really do this invalidation internally as + * it will know if we've allocated over a holei for this specific IO and + * if so it needs to update the mapping tree and invalidate existing + * PTEs over the newly allocated range. Remove this invalidation when + * dax_do_io() is fixed up. */ if (mapping->nrpages) { - ret = invalidate_inode_pages2(mapping); + loff_t end = iocb->ki_pos + iov_iter_count(from) - 1; + + ret = invalidate_inode_pages2_range(mapping, + iocb->ki_pos >> PAGE_SHIFT, + end >> PAGE_SHIFT); WARN_ON_ONCE(ret); } |