lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sat, 23 May 2015 23:02:21 -0400
From:	Phillip Susi <>
Subject: [PATCH] resize2fs: fix minimum size calculation

The size calculation adds an initial number of block groups needed to hold
the inodes on the fs, then augments them with additional groups needed to
reach the minimum number of data blocks, and then calculates the size of
the last block group ( which should be a fraction of one block group ).  It
was calculating a last bg size of several block groups because when adding
the supplementary bgs, it only advanced the position of the start of the
last group by one group, even though it was adding multiple groups.  Add
the missing multiplier to move the last bg start position up to the correct
location, thus computing a proper fractional last bg size.
 resize/resize2fs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/resize/resize2fs.c b/resize/resize2fs.c
index 041ff75..3359a8f 100644
--- a/resize/resize2fs.c
+++ b/resize/resize2fs.c
@@ -2870,7 +2870,7 @@ blk64_t calculate_minimum_resize_size(ext2_filsys fs, int flags)
 		/* ok we have to account for the last group */
 		overhead = calc_group_overhead(fs, groups-1, old_desc_blocks);
-		last_start += EXT2_BLOCKS_PER_GROUP(fs->super) - overhead;
+		last_start += (EXT2_BLOCKS_PER_GROUP(fs->super) * extra_grps) - overhead;
 		grp = flex_groups;
 		groups += extra_grps;

To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to
More majordomo info at

Powered by blists - more mailing lists