[LTP] [PATCH v2 1/1] zram01.sh: Fix minimal size for XFS on kernel 5.19

Petr Vorel pvorel@suse.cz
Fri Sep 30 11:12:08 CEST 2022


mkfs.xfs for kernel 5.19 bumps minimum filesystems 300 MB. Due this we
already updated minimal filesystem size for all_filesystems /
$TST_ALL_FILESYSTEMS in 66e05c841. But zram01.sh does not use the API,
thus update it now.

Also require 1G of RAM for XFS (check originally added in f18c8fd3a for
Btrfs on ppc64le due to larger page size, likely needed for also XFS).

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
Changes v1->v2:
* add 1GB memory check also for XFS (check_space_for_fs, Cyril)

Kind regards,
Petr

 testcases/kernel/device-drivers/zram/zram01.sh | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/testcases/kernel/device-drivers/zram/zram01.sh b/testcases/kernel/device-drivers/zram/zram01.sh
index 8b92b699f..d4e46c247 100755
--- a/testcases/kernel/device-drivers/zram/zram01.sh
+++ b/testcases/kernel/device-drivers/zram/zram01.sh
@@ -11,13 +11,14 @@ TST_TESTFUNC="do_test"
 TST_NEEDS_CMDS="awk bc dd"
 TST_SETUP="setup"
 
-check_space_for_btrfs()
+check_space_for_fs()
 {
+	local fs="$1"
 	local ram_size
 
 	ram_size=$(awk '/MemTotal:/ {print $2}' /proc/meminfo)
 	if [ "$ram_size" -lt 1048576 ]; then
-		tst_res TINFO "not enough space for Btrfs"
+		tst_res TINFO "not enough space for $fs"
 		return 1
 	fi
 	return 0
@@ -41,9 +42,15 @@ initialize_vars()
 	for fs in $(tst_supported_fs -s tmpfs); do
 		size="26214400"
 		limit="25M"
-		if [ "$fs" = "btrfs" ]; then
-			check_space_for_btrfs || continue
-			size="402653184"
+
+		if [ "$fs" = "btrfs" -o "$fs" = "xfs" ]; then
+			check_space_for_fs "$fs" || continue
+
+			if [ "$fs" = "btrfs" ]; then
+				size="402653184"
+			elif [ "$fs" = "xfs" ]; then
+				size=314572800
+			fi
 			limit="$((size/1024/1024))M"
 		fi
 
-- 
2.37.3



More information about the ltp mailing list