Add patch SR-ext4-resize-mark-new-group-EXT_BG_INODE_ZEROED.patch
[ext4-patch-queue/an.git] / SR-ext4-resize-mark-new-group-EXT_BG_INODE_ZEROED.patch
blob759598b7b1f1ce415472898ead6d1f2ed6adbd34
1 ext4: When resizing set the EXT4_BG_INODE_ZEROED flag for new block groups
3 From: Solofo.Ramangalahy@bull.net
5 The inode table has been zeroed in setup_new_group_blocks(). Mark it as
6 such in ext4_group_add(). Since we are currently clearing inode table
7 for the new block group, we should set the EXT4_BG_INODE_ZEROED flag.
8 If at some point in the future we don't immediately zero out the inode
9 table as part of the resize operation, then obviously we shouldn't do
10 this.
12 Signed-off-by: Solofo.Ramangalahy@bull.net
13 Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
14 ---
15 diff --git a/fs/ext4/resize.c b/fs/ext4/resize.c
16 index b6ec184..d448eb1 100644
17 --- a/fs/ext4/resize.c
18 +++ b/fs/ext4/resize.c
19 @@ -864,6 +864,7 @@ int ext4_group_add(struct super_block *sb, struct ext4_new_group_data *input)
20 ext4_inode_table_set(sb, gdp, input->inode_table); /* LV FIXME */
21 gdp->bg_free_blocks_count = cpu_to_le16(input->free_blocks_count);
22 gdp->bg_free_inodes_count = cpu_to_le16(EXT4_INODES_PER_GROUP(sb));
23 + gdp->bg_flags |= cpu_to_le16(EXT4_BG_INODE_ZEROED);
24 gdp->bg_checksum = ext4_group_desc_csum(sbi, input->group, gdp);