summaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_file.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2016-09-05 12:09:59 +0200
committerIngo Molnar <mingo@kernel.org>2016-09-05 12:09:59 +0200
commit2cc538412a1ca103923ec400a339a5b3833e0280 (patch)
treec141b83e1da736c3d069ed491816d0096e1b532a /fs/xfs/xfs_file.c
parent36e674a05164cdbb9d4a5b1b0b279fabae6c13bd (diff)
parent58763148758057ffc447bf990321d3ea86d199a0 (diff)
downloadlinux-2cc538412a1ca103923ec400a339a5b3833e0280.tar.bz2
Merge branch 'perf/urgent' into perf/core, to pick up fixed and resolve conflicts
Conflicts: kernel/events/core.c Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'fs/xfs/xfs_file.c')
-rw-r--r--fs/xfs/xfs_file.c13
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);
}