Whamcloud - gitweb
libext2fs: fix rbtree backend for extent lengths greater than 2^32
authorEric Sandeen <sandeen@redhat.com>
Mon, 28 May 2012 02:13:39 +0000 (22:13 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 28 May 2012 02:14:29 +0000 (22:14 -0400)
commit918eeb32e9bd1d053bafc9d3c70ef420c21eeda9
treeb6edcb155474072d8d3496651a3f15d394bb6180
parent97a67c40dc36a4cfc50192fe96ed12689718af94
libext2fs: fix rbtree backend for extent lengths greater than 2^32

For a completely full filesystem with more than 2^32 blocks, the
rbtree bitmap backend can assemble an extent of used blocks which is
longer than 2^32.  If it does, it will overflow ->count, and corrupt
the rbtree for the bitmaps.

Discovered by completely filling a 32T filesystem using fallocate, and
then observing debugfs, dumpe2fs, and e2fsck all behaving badly.

(Note that filling with only 31 x 1T files did not show the problem,
because freespace was fragmented enough that there was no sufficiently
long range of used blocks.)

Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
lib/ext2fs/blkmap64_rb.c