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>
This fixes some (but not all) of the compatibility bugs which prevented
e2fsprogs from being compiled on a Linux 2.0.35 system. There are still
some unprotected use of long long's, and apparently some type problems
with the uuid library, but these can be fixed up later.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Currently filefrag uses signed int for block numbers, thus it reporting
corrupted block number for a file on a more than 8TB ext3. The following
trivial patch replace the signed int type block number with "unsigned
long type.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
an integer, not an unsigned long. Fix this to avoid problems on 64-bit
platforms where the size of an integer != the size of a long.
(Addresses Debian Bug #309655)
stored using the new experimental file fragments format,
and use the non-ext2 algorithm for determing the number of
extents. Avoid reporting a false discontinuity if there
is a non-allocated block (or extent) at the beginning of
the file.