ext3, ext4: avoid divide by zero
authorAndries E. Brouwer <Andries.Brouwer@cwi.nl>
Tue, 18 Dec 2007 00:19:55 +0000 (16:19 -0800)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Tue, 18 Dec 2007 03:28:16 +0000 (19:28 -0800)
commitb47b6f38e5202c924bfe7632dce5dda4e3d40731
treeb9dfeb426adc7125ac7828d5b646d893163314c6
parent9e2de407bec98fb07040f658f55fb71ba1b594f5
ext3, ext4: avoid divide by zero

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.

Cc: <linux-ext4@vger.kernel.org>
Acked-by: Alan Cox <alan@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/ext3/super.c
fs/ext4/super.c