Skip to contentSkip to conversation

mkfs: relax size check

PATCH New Jan Stancek 3 participants 5 messages Apr 23, 2021 – Apr 26, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mkfs: relax size check

Number of total data blocks in filesystem reported by statfs may be less than current formula of 90%. For example ext4 will subtract "s_first_data_block plus internal journal blocks".

With recent change to e2fsprogs, overhead calculated in user-space increased slightly and LTP test started failing:
https://github.com/tytso/e2fsprogs/commit/59037c5357d39c6d0f14a0aff70e67dc13eafc84

Since there's no strict rule how much the overhead will be, as rule of thumb relax the condition to 80%.

---
I haven't found better way to set the test expectation, so to address immediate failures I propose to relax the check.

 testcases/commands/mkfs/mkfs01.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
testcases/commands/mkfs/mkfs01.sh +2 -2
index 13491c9685ae..3e3e56719cf3 100755
@@ -69,11 +69,11 @@ mkfs_verify_size()
 	# 1k-block size should be devided by this argument for ntfs verification.
 	if [ "$1" = "ntfs" ]; then
 		local rate=1024/512
-		if [ $blocknum -lt "$(($2/$rate*9/10))" ]; then
+		if [ $blocknum -lt "$(($2/$rate*8/10))" ]; then
 			return 1
 		fi
 	else
-		if [ $blocknum -lt "$(($2*9/10))" ]; then
+		if [ $blocknum -lt "$(($2*8/10))" ]; then
 			return 1
 		fi
 	fi
Signature · 1 line
2.18.1
#2 lore raw

PATCH 1/1 mkfs: relax size check

Hi Jan,

Quoted 2 lines

Yes, I also noticed mkfs01_ext3_sh and mkfs01_ext4_sh on mainline, this could help. Thanks!

Yes, it fixes the problem otherwise reproducible on openSUSE, which uses e2fsprogs 1.46.2 with commit 59037c53.

Kind regards,
Petr

#3 lore raw

PATCH 1/1 mkfs: relax size check

In reply to Jan Stancek
Quoted 5 lines · Jan Stancek

Number of total data blocks in filesystem reported by statfs may be less than current formula of 90%. For example ext4 will subtract "s_first_data_block plus internal journal blocks".

Quoted 8 lines

With recent change to e2fsprogs, overhead calculated in user-space increased slightly and LTP test started failing:
https://github.com/tytso/e2fsprogs/commit/59037c5357d39c6d0f14a0aff70e67dc13eafc84

Since there's no strict rule how much the overhead will be, as rule of thumb relax the condition to 80%.

Signature · 2 lines
Regards,
Li Wang
#4 lore raw

PATCH 1/1 mkfs: relax size check

Hi Jan, Li,

Quoted 10 lines · Jan Stancek
Quoted 8 lines

Number of total data blocks in filesystem reported by statfs may be less than current formula of 90%. For example ext4 will subtract "s_first_data_block plus internal journal blocks".

With recent change to e2fsprogs, overhead calculated in user-space increased slightly and LTP test started failing:
https://github.com/tytso/e2fsprogs/commit/59037c5357d39c6d0f14a0aff70e67dc13eafc84

Quoted 6 lines
Quoted 4 lines

Since there's no strict rule how much the overhead will be, as rule of thumb relax the condition to 80%.

I dared to merge your fix. Thanks!

Kind regards,
Petr