From: Theodore Ts'o Date: Mon, 29 Apr 2024 03:26:19 +0000 (-0400) Subject: resize2fs: fix last bg's free clusters calculation on 64-bit file systems X-Git-Tag: archive/debian/1.47.1_rc1-3~2^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1da249a125cb2ae138a6dd1d262754e2b4d45175;p=thirdparty%2Fe2fsprogs.git resize2fs: fix last bg's free clusters calculation on 64-bit file systems Fixes-Coverity-bug: 1596645 Fixes: d43fb24ca0db ("resize2fs: fix r_bigalloc_big_expand test failure") Signed-off-by: Theodore Ts'o --- diff --git a/resize/resize2fs.c b/resize/resize2fs.c index 4daa068b..f4a40980 100644 --- a/resize/resize2fs.c +++ b/resize/resize2fs.c @@ -2870,7 +2870,8 @@ static errcode_t resize2fs_calculate_summary_stats(ext2_filsys fs) if ((group == fs->group_desc_count - 1) && (max & 7)) { n = 0; for (b = (fs->super->s_first_data_block + - (fs->super->s_blocks_per_group * group)); + ((blk64_t) fs->super->s_blocks_per_group * + group)); b < ext2fs_blocks_count(fs->super); b += EXT2FS_CLUSTER_RATIO(fs)) { if (ext2fs_test_block_bitmap2(fs->block_map, b))