[PATCH]
PATCH 1/1 [PATCH]
As it turns out, the kernel divides by EXT3_INODES_PER_GROUP(s) when mounting an ext3 filesystem. If that number is zero, a crash follows. Below a patch.
This crash was reported by Joeri de Ruiter, Carst Tankink and Pim Vullers.
Andries
fs/ext3/super.c +1 -1
@@ -1596,7 +1596,7 @@ static int ext3_fill_super (struct super sbi->s_blocks_per_group =le32_to_cpu (es->s_blocks_per_group); sbi->s_frags_per_group =le32_to_cpu (es->s_frags_per_group); sbi->s_inodes_per_group =le32_to_cpu (es->s_inodes_per_group); -if (EXT3_INODE_SIZE (sb) ==0 ) +if (EXT3_INODE_SIZE (sb) ==0 ||EXT3_INODES_PER_GROUP (sb) ==0 ) goto cantfind_ext3; sbi->s_inodes_per_block = blocksize /EXT3_INODE_SIZE (sb);if (sbi->s_inodes_per_block ==0 )
fs/ext4/super.c +1 -1
@@ -1678,7 +1678,7 @@ static int ext4_fill_super (struct super sbi->s_blocks_per_group =le32_to_cpu (es->s_blocks_per_group); sbi->s_frags_per_group =le32_to_cpu (es->s_frags_per_group); sbi->s_inodes_per_group =le32_to_cpu (es->s_inodes_per_group); -if (EXT4_INODE_SIZE (sb) ==0 ) +if (EXT4_INODE_SIZE (sb) ==0 ||EXT4_INODES_PER_GROUP (sb) ==0 ) goto cantfind_ext4; sbi->s_inodes_per_block = blocksize /EXT4_INODE_SIZE (sb);if (sbi->s_inodes_per_block ==0 )
Quoted 5 lines · On Mon, 3 Dec 2007 16:54:55 +0100 "Andries E. Brouwer"…
As it turns out, the kernel divides by
EXT3_INODES_PER_GROUP(s)when mounting an ext3 filesystem. If that number is zero, a crash follows. Below a patch.This crash was reported by Joeri de Ruiter, Carst Tankink and Pim Vullers.
Acked-by Alan Cox <[email protected]>