aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4/extents.c
diff options
context:
space:
mode:
authorAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>2008-07-11 19:27:31 -0400
committerTheodore Ts'o <tytso@mit.edu>2008-07-11 19:27:31 -0400
commita379cd1d6bb00f9f5d2759d4a5621a884df5914e (patch)
tree437211f483736d3a2335cbca20e771b099b6bf77 /fs/ext4/extents.c
parent363d4251d4bd984c304e0989789f6494343660fd (diff)
ext4: Update i_disksize properly when allocating from fallocate area.
When allocating unitialized space at the end of file which had been preallocated with the FALLOC_FL_KEEP_SIZE option, the file size is not updated at that time. But the later we are not updating the file size when writing to that preallocated space. These changes are for code correctness. This patch allows us to update the i_disksize at the write_end() callback of filesystem properly. Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Signed-off-by: Mingming Cao <cmm@us.ibm.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/extents.c')
-rw-r--r--fs/ext4/extents.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index 47929c4e3dae..f7a746b5b7be 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -2716,13 +2716,13 @@ int ext4_ext_get_blocks(handle_t *handle, struct inode *inode,
2716 goto out2; 2716 goto out2;
2717 } 2717 }
2718 2718
2719 if (extend_disksize && inode->i_size > EXT4_I(inode)->i_disksize)
2720 EXT4_I(inode)->i_disksize = inode->i_size;
2721
2722 /* previous routine could use block we allocated */ 2719 /* previous routine could use block we allocated */
2723 newblock = ext_pblock(&newex); 2720 newblock = ext_pblock(&newex);
2724 allocated = ext4_ext_get_actual_len(&newex); 2721 allocated = ext4_ext_get_actual_len(&newex);
2725outnew: 2722outnew:
2723 if (extend_disksize && inode->i_size > EXT4_I(inode)->i_disksize)
2724 EXT4_I(inode)->i_disksize = inode->i_size;
2725
2726 __set_bit(BH_New, &bh_result->b_state); 2726 __set_bit(BH_New, &bh_result->b_state);
2727 2727
2728 /* Cache only when it is _not_ an uninitialized extent */ 2728 /* Cache only when it is _not_ an uninitialized extent */