aboutsummaryrefslogtreecommitdiffstats
path: root/debian/patches/0002-resize2fs-fix-last-bg-s-free-clusters-calculation
blob: 434ccc844d6b6a43c9a5ebe3fcbea8905670ff8e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
From 1da249a125cb2ae138a6dd1d262754e2b4d45175 Mon Sep 17 00:00:00 2001
From: Theodore Ts'o <tytso@mit.edu>
Date: Sun, 28 Apr 2024 23:26:19 -0400
Subject: [PATCH 2/6] 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 <tytso@mit.edu>
---
 resize/resize2fs.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/resize/resize2fs.c b/resize/resize2fs.c
index 4daa068b8..f4a409805 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))
-- 
2.43.0