Whamcloud - gitweb
Fix 32/64-bit overflow when multiplying by blocks/clusters per group
[tools/e2fsprogs.git] / misc / tune2fs.c
index 6b21235..ad0b05f 100644 (file)
@@ -1383,7 +1383,7 @@ static int ext2fs_is_block_in_group(ext2_filsys fs, dgrp_t group, blk64_t blk)
 {
        blk64_t start_blk, end_blk;
        start_blk = fs->super->s_first_data_block +
-                       EXT2_BLOCKS_PER_GROUP(fs->super) * group;
+                       EXT2_GROUPS_TO_BLOCKS(fs->super, group);
        /*
         * We cannot get new block beyond end_blk for for the last block group
         * so we can check with EXT2_BLOCKS_PER_GROUP even for last block group