diff options
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( | |||
741 | * page is inserted into the pagecache when we have to serve a write | 741 | * page is inserted into the pagecache when we have to serve a write |
742 | * fault on a hole. It should never be dirtied and can simply be | 742 | * fault on a hole. It should never be dirtied and can simply be |
743 | * dropped from the pagecache once we get real data for the page. | 743 | * dropped from the pagecache once we get real data for the page. |
744 | * | ||
745 | * XXX: This is racy against mmap, and there's nothing we can do about | ||
746 | * it. dax_do_io() should really do this invalidation internally as | ||
747 | * it will know if we've allocated over a holei for this specific IO and | ||
748 | * if so it needs to update the mapping tree and invalidate existing | ||
749 | * PTEs over the newly allocated range. Remove this invalidation when | ||
750 | * dax_do_io() is fixed up. | ||
744 | */ | 751 | */ |
745 | if (mapping->nrpages) { | 752 | if (mapping->nrpages) { |
746 | ret = invalidate_inode_pages2(mapping); | 753 | loff_t end = iocb->ki_pos + iov_iter_count(from) - 1; |
754 | |||
755 | ret = invalidate_inode_pages2_range(mapping, | ||
756 | iocb->ki_pos >> PAGE_SHIFT, | ||
757 | end >> PAGE_SHIFT); | ||
747 | WARN_ON_ONCE(ret); | 758 | WARN_ON_ONCE(ret); |
748 | } | 759 | } |
749 | 760 | ||