Add commit fix-nodelalloc-and-data-journal
[ext4-patch-queue.git] / allow-punch-hole-beyond-i_sze
blob8d2ab6a216d8ddbe5d562389d6a4c3f129cddfb1
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>
12 ---
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;
22         int credits, err = 0;
24 -       /* No need to punch hole beyond i_size */
25 -       if (offset >= inode->i_size)
26 -               return 0;
28 -       /*
29 -        * If the hole extends beyond i_size, set the hole
30 -        * to end after the page that contains i_size
31 -        */
32 -       if (offset + length > inode->i_size) {
33 -               length = inode->i_size +
34 -                  PAGE_CACHE_SIZE - (inode->i_size & (PAGE_CACHE_SIZE - 1)) -
35 -                  offset;
36 -       }
38         first_page = (offset + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT;
39         last_page = (offset + length) >> PAGE_CACHE_SHIFT;
41 -- 
42 1.7.4.4