Fix grammar in comment.
[ext4-patch-queue.git] / ext4-update-i_disksize-for-fallocate.patch
blob895b64d9f16643bb8bb2fdff018e9275e08c4ac7
1 ext4: Update i_disksize properly when allocating from fallocate area.
3 From: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
5 When allocating unitialized space at the end of file which had been
6 preallocated with the FALLOC_FL_KEEP_SIZE option, the file size is not
7 updated at that time. But the later we are not updating the file size
8 when writing to that preallocated space.
10 These changes are for code correctness. This patch allows us to update
11 the i_disksize at the write_end() callback of filesystem properly.
13 Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
14 Signed-off-by: Mingming Cao <cmm@us.ibm.com>
15 Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
16 ---
17 fs/ext4/extents.c | 6 +++---
18 1 file changed, 3 insertions(+), 3 deletions(-)
20 Index: linux-2.6.26-rc6/fs/ext4/extents.c
21 ===================================================================
22 --- linux-2.6.26-rc6.orig/fs/ext4/extents.c 2008-06-17 10:43:20.000000000 -0700
23 +++ linux-2.6.26-rc6/fs/ext4/extents.c 2008-06-17 10:43:28.000000000 -0700
24 @@ -2716,13 +2716,13 @@ int ext4_ext_get_blocks(handle_t *handle
25 goto out2;
28 - if (extend_disksize && inode->i_size > EXT4_I(inode)->i_disksize)
29 - EXT4_I(inode)->i_disksize = inode->i_size;
31 /* previous routine could use block we allocated */
32 newblock = ext_pblock(&newex);
33 allocated = ext4_ext_get_actual_len(&newex);
34 outnew:
35 + if (extend_disksize && inode->i_size > EXT4_I(inode)->i_disksize)
36 + EXT4_I(inode)->i_disksize = inode->i_size;
38 __set_bit(BH_New, &bh_result->b_state);
40 /* Cache only when it is _not_ an uninitialized extent */