1 ext4: allow punch hole beyond i_size
3 From: Allison Henderson <achender@linux.vnet.ibm.com>
5 This patch allows blocks beyond i_size to be punched out.
6 This early return to catch this condition is simply removed
7 allowing punch hole to proceed beyond i_size.
9 Signed-off-by: Allison Henderson <achender@linux.vnet.ibm.com>
10 Signed-off-by: Lukas Czerner <lczerner@redhat.com>
11 Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
13 fs/ext4/extents.c | 14 --------------
14 1 files changed, 0 insertions(+), 14 deletions(-)
16 diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
17 index 7b822c0..7d4f2cb 100644
18 --- a/fs/ext4/extents.c
19 +++ b/fs/ext4/extents.c
20 @@ -4689,20 +4689,6 @@ int ext4_ext_punch_hole(struct file *file, loff_t offset, loff_t length)
21 loff_t first_page_offset, last_page_offset;
24 - /* No need to punch hole beyond i_size */
25 - if (offset >= inode->i_size)
29 - * If the hole extends beyond i_size, set the hole
30 - * to end after the page that contains i_size
32 - if (offset + length > inode->i_size) {
33 - length = inode->i_size +
34 - PAGE_CACHE_SIZE - (inode->i_size & (PAGE_CACHE_SIZE - 1)) -
38 first_page = (offset + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT;
39 last_page = (offset + length) >> PAGE_CACHE_SHIFT;