[LTP] [PATCH] mkfs: relax size check

zenghongling zenghongling@kylinos.cn
Tue Nov 29 04:17:11 CET 2022


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:
  tytso/e2fsprogs

mkfs01 1 TPASS: 'mkfs -t ext4  /dev/loop0 ' passed.
mkfs01 2 TFAIL: 'mkfs -t ext4  /dev/loop0 16000' failed, not expected.

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

Signed-off-by: zenghongling <zenghongling@kylinos.cn>
---
 testcases/commands/mkfs/mkfs01.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/testcases/commands/mkfs/mkfs01.sh b/testcases/commands/mkfs/mkfs01.sh
index 263aa47..a964774 100755
--- a/testcases/commands/mkfs/mkfs01.sh
+++ b/testcases/commands/mkfs/mkfs01.sh
@@ -66,11 +66,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*8/10))" ]; then
+		if [ $blocknum -lt "$(($2/$rate*7/10))" ]; then
 			return 1
 		fi
 	else
-		if [ $blocknum -lt "$(($2*8/10))" ]; then
+		if [ $blocknum -lt "$(($2*7/10))" ]; then
 			return 1
 		fi
 	fi
-- 
2.1.0



More information about the ltp mailing list