• Theodore Ts'o's avatar
    Fix 32/64-bit overflow when multiplying by blocks/clusters per group · 1e33a8b4
    Theodore Ts'o authored
    
    
    There are a number of places where we need convert groups to blocks or
    clusters by multiply the groups by blocks/clusters per group.
    Unfortunately, both quantities are 32-bit, but the result needs to be
    64-bit, and very often the cast to 64-bit gets lost.
    
    Fix this by adding new macros, EXT2_GROUPS_TO_BLOCKS() and
    EXT2_GROUPS_TO_CLUSTERS().
    
    This should fix a bug where resizing a 64bit file system can result in
    calculate_minimum_resize_size() looping forever.
    
    Addresses-Launchpad-Bug: #1321958
    Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
    1e33a8b4
imager.c 8 KB