X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=mm%2Fshmem.c;h=70da7a0981bfbad9683b5e9b0747277256a678ff;hb=f740d1689d91415cfc749d17138a11ed03b7d38b;hp=4bb28d218eb5caf064026e479873cc994e282a88;hpb=9b3a89f8b052f2a6193a9691e053f986144a65a0;p=linux-2.6-omap-h63xx.git diff --git a/mm/shmem.c b/mm/shmem.c index 4bb28d218eb..70da7a0981b 100644 --- a/mm/shmem.c +++ b/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);