Add patch SR-ext4-resize-mark-new-group-EXT_BG_INODE_ZEROED.patch
[ext4-patch-queue/an.git] / ext4-online-resize-fix-for-group-descriptor-corruption.patch
blob0e3dcd411f63a025b40d26057a1921aa84740033
1 ext4: Fix online resize block group descriptor corruption
3 From: Frederic Bohe <frederic.bohe@bull.net>
5 This is the patch for the group descriptor table corruption during
6 online resize pointed out by Theodore Tso. The problem was caused by
7 the fact that the ext4 group descriptor can be either 32 or 64 bytes
8 long. Only the 64 bytes structure was taken into account.
10 Signed-off-by: Frederic Bohe <frederic.bohe@bull.net>
11 Signed-off-by: Mingming Cao <cmm@us.ibm.com>
12 Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
13 ---
14 fs/ext4/resize.c | 3 ++-
15 1 file changed, 2 insertions(+), 1 deletion(-)
17 Index: linux-2.6.26-rc6/fs/ext4/resize.c
18 ===================================================================
19 --- linux-2.6.26-rc6.orig/fs/ext4/resize.c 2008-06-17 10:43:22.000000000 -0700
20 +++ linux-2.6.26-rc6/fs/ext4/resize.c 2008-06-17 10:43:22.000000000 -0700
21 @@ -855,7 +855,8 @@ int ext4_group_add(struct super_block *s
24 /* Update group descriptor block for new group */
25 - gdp = (struct ext4_group_desc *)primary->b_data + gdb_off;
26 + gdp = (struct ext4_group_desc *)((char *)primary->b_data +
27 + gdb_off * EXT4_DESC_SIZE(sb));
29 ext4_block_bitmap_set(sb, gdp, input->block_bitmap); /* LV FIXME */
30 ext4_inode_bitmap_set(sb, gdp, input->inode_bitmap); /* LV FIXME */