diff --git a/[refs] b/[refs] index 36ff481e8d39..559498439349 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: ba0084048ab785c2cb1d6cc2cccabe642a5b799a +refs/heads/master: 92a3d03aab912624cae799e5772a6eb2ef55083f diff --git a/trunk/mm/shmem.c b/trunk/mm/shmem.c index 4bb28d218eb5..70da7a0981bf 100644 --- a/trunk/mm/shmem.c +++ b/trunk/mm/shmem.c @@ -515,7 +515,12 @@ static void shmem_truncate_range(struct inode *inode, loff_t start, loff_t end) size = SHMEM_NR_DIRECT; nr_swaps_freed = shmem_free_swp(ptr+idx, ptr+size); } - if (!topdir) + + /* + * If there are no indirect blocks or we are punching a hole + * below indirect blocks, nothing to be done. + */ + if (!topdir || (punch_hole && (limit <= SHMEM_NR_DIRECT))) goto done2; BUG_ON(limit <= SHMEM_NR_DIRECT);