Skip to content

Commit 2856922

Browse files
Frederic Bohetytso
authored andcommitted
Ext4: Fix online resize block group descriptor corruption
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]>
1 parent 5dd3457 commit 2856922

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

fs/ext4/resize.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -855,7 +855,8 @@ int ext4_group_add(struct super_block *sb, struct ext4_new_group_data *input)
855855
*/
856856

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

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

0 commit comments

Comments
 (0)