Skip to content

Commit

Permalink
Ext4: Fix online resize block group descriptor corruption
Browse files Browse the repository at this point in the history
This is the patch for the group descriptor table corruption during
online resize pointed out by Theodore Tso.  The problem was caused by
the fact that the ext4 group descriptor can be either 32 or 64 bytes
long.  Only the 64 bytes structure was taken into account.

Signed-off-by: Frederic Bohe <[email protected]>
Signed-off-by: Mingming Cao <[email protected]>
Signed-off-by: "Theodore Ts'o" <[email protected]>
  • Loading branch information
Frederic Bohe authored and tytso committed Jun 20, 2008
1 parent 5dd3457 commit 2856922
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fs/ext4/resize.c
Original file line number Diff line number Diff line change
Expand Up @@ -855,7 +855,8 @@ int ext4_group_add(struct super_block *sb, struct ext4_new_group_data *input)
*/

/* Update group descriptor block for new group */
gdp = (struct ext4_group_desc *)primary->b_data + gdb_off;
gdp = (struct ext4_group_desc *)((char *)primary->b_data +
gdb_off * EXT4_DESC_SIZE(sb));

ext4_block_bitmap_set(sb, gdp, input->block_bitmap); /* LV FIXME */
ext4_inode_bitmap_set(sb, gdp, input->inode_bitmap); /* LV FIXME */
Expand Down

0 comments on commit 2856922

Please sign in to comment.