diff options
-rw-r--r-- | fs/xfs/xfs_file.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c index 076b1708d134..827cfb2451b1 100644 --- a/fs/xfs/xfs_file.c +++ b/fs/xfs/xfs_file.c | |||
@@ -296,7 +296,16 @@ xfs_file_read_iter( | |||
296 | xfs_rw_iunlock(ip, XFS_IOLOCK_EXCL); | 296 | xfs_rw_iunlock(ip, XFS_IOLOCK_EXCL); |
297 | return ret; | 297 | return ret; |
298 | } | 298 | } |
299 | truncate_pagecache_range(VFS_I(ip), pos, -1); | 299 | |
300 | /* | ||
301 | * Invalidate whole pages. This can return an error if | ||
302 | * we fail to invalidate a page, but this should never | ||
303 | * happen on XFS. Warn if it does fail. | ||
304 | */ | ||
305 | ret = invalidate_inode_pages2_range(VFS_I(ip)->i_mapping, | ||
306 | pos >> PAGE_CACHE_SHIFT, -1); | ||
307 | WARN_ON_ONCE(ret); | ||
308 | ret = 0; | ||
300 | } | 309 | } |
301 | xfs_rw_ilock_demote(ip, XFS_IOLOCK_EXCL); | 310 | xfs_rw_ilock_demote(ip, XFS_IOLOCK_EXCL); |
302 | } | 311 | } |