* ext2 fix
@ 2006-08-22 11:01 Andries.Brouwer
0 siblings, 0 replies; only message in thread
From: Andries.Brouwer @ 2006-08-22 11:01 UTC (permalink / raw)
To: akpm, torvalds; +Cc: linux-kernel
Mounting an ext2 filesystem with zero s_inodes_per_group
will cause a divide error. Below a patch against 2.6.17.8.
Andries
diff -uprN -X /linux/dontdiff a/fs/ext2/super.c b/fs/ext2/super.c
--- a/fs/ext2/super.c 2006-08-07 16:01:12.000000000 +0200
+++ b/fs/ext2/super.c 2006-08-22 12:36:45.682620352 +0200
@@ -776,7 +776,7 @@ static int ext2_fill_super(struct super_
if (EXT2_INODE_SIZE(sb) == 0)
goto cantfind_ext2;
sbi->s_inodes_per_block = sb->s_blocksize / EXT2_INODE_SIZE(sb);
- if (sbi->s_inodes_per_block == 0)
+ if (sbi->s_inodes_per_block == 0 || sbi->s_inodes_per_group == 0)
goto cantfind_ext2;
sbi->s_itb_per_group = sbi->s_inodes_per_group /
sbi->s_inodes_per_block;
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2006-08-22 11:01 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-22 11:01 ext2 fix Andries.Brouwer
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.