Whamcloud - gitweb
resize2fs: fix 32-bit overflow issue which can corrupt 64-bit file systems
authorTheodore Ts'o <tytso@mit.edu>
Thu, 3 Jan 2013 04:31:04 +0000 (23:31 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 3 Jan 2013 13:38:45 +0000 (08:38 -0500)
commit5d3a88fbe9e0291d7d5baa8391cbd78d9cc29767
treea9ba2d6f11c5e28b740692f1f989a979a49223a6
parentccfedb17b110d8eec6343a1c3a6a2437fea4dbc2
resize2fs: fix 32-bit overflow issue which can corrupt 64-bit file systems

Fix a 32-bit overflow bug caused by a missing blk64_t cast which can
cause the block bitmap to get corrupted when doing an off-line resize
of a 64-bit file system.

This problem can be reproduced as follows:

rm -f foo.img; touch foo.img
truncate -s 8T foo.img
mke2fs -F -t ext4 -O 64bit foo.img
e2fsck -f foo.img
truncate -s 21T foo.img
resize2fs foo.img
e2fsck -fy foo.img

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
resize/resize2fs.c