aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
Diffstat (limited to 'mm')
-rw-r--r--mm/shmem.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/mm/shmem.c b/mm/shmem.c
index 578eceafba4a..b2a35ebf071a 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -674,8 +674,16 @@ done2:
674 * generic_delete_inode did it, before we lowered next_index. 674 * generic_delete_inode did it, before we lowered next_index.
675 * Also, though shmem_getpage checks i_size before adding to 675 * Also, though shmem_getpage checks i_size before adding to
676 * cache, no recheck after: so fix the narrow window there too. 676 * cache, no recheck after: so fix the narrow window there too.
677 *
678 * Recalling truncate_inode_pages_range and unmap_mapping_range
679 * every time for punch_hole (which never got a chance to clear
680 * SHMEM_PAGEIN at the start of vmtruncate_range) is expensive,
681 * yet hardly ever necessary: try to optimize them out later.
677 */ 682 */
678 truncate_inode_pages_range(inode->i_mapping, start, end); 683 truncate_inode_pages_range(inode->i_mapping, start, end);
684 if (punch_hole)
685 unmap_mapping_range(inode->i_mapping, start,
686 end - start, 1);
679 } 687 }
680 688
681 spin_lock(&info->lock); 689 spin_lock(&info->lock);