OSDN Git Service

ext4: check for zero length extent
authorTheodore Ts'o <tytso@mit.edu>
Mon, 12 Mar 2012 03:30:16 +0000 (23:30 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 2 Apr 2012 16:27:19 +0000 (09:27 -0700)
commit471320c7569290aeed04f9c730d92b67b9acb53d
treed438461965b6e1c4deaac959504cf7919d5d2555
parentdf3c660b5745e71665270141ced3fff82a4b0aa6
ext4: check for zero length extent

commit 31d4f3a2f3c73f279ff96a7135d7202ef6833f12 upstream.

Explicitly test for an extent whose length is zero, and flag that as a
corrupted extent.

This avoids a kernel BUG_ON assertion failure.

Tested: Without this patch, the file system image found in
tests/f_ext_zero_len/image.gz in the latest e2fsprogs sources causes a
kernel panic.  With this patch, an ext4 file system error is noted
instead, and the file system is marked as being corrupted.

https://bugzilla.kernel.org/show_bug.cgi?id=42859

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/ext4/extents.c