]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commit - misc/mke2fs.c
Fix potential 2**32-1 overflow problems by ext2fs_div_ceil()
authorTheodore Ts'o <tytso@mit.edu>
Wed, 30 Aug 2006 05:57:00 +0000 (01:57 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Wed, 30 Aug 2006 05:57:00 +0000 (01:57 -0400)
commit69022e029f3273b3b860bf701219cd3fe615f76b
tree81ecd1b770fe3a4d8e0c325ce78bc6f0c17c927b
parenta3e025c7493b58ec88b775f26a41e4205a6a2c9f
Fix potential 2**32-1 overflow problems by ext2fs_div_ceil()

Add a new function, ext2fs_div_ceil(), which correctly calculates a division
of two unsigned integer where the result is always rounded up the next
largest integer.   This is used everywhere where we might have
previously caused an overflow when the number of blocks
or inodes is too close to 2**32-1.

Based on patches from Eric Sandeen, but generalized to use this new function

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Eric Sandeen <esandeen@redhat.com>
ext2ed/ChangeLog
ext2ed/init.c
lib/ext2fs/ChangeLog
lib/ext2fs/ext2fs.h
lib/ext2fs/initialize.c
lib/ext2fs/openfs.c
misc/ChangeLog
misc/filefrag.c
misc/mke2fs.c
resize/ChangeLog
resize/resize2fs.c