public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH v2 1/1] zram01.sh: Fix minimal size for XFS on kernel 5.19
@ 2022-09-30  9:12 Petr Vorel
  2022-09-30  9:21 ` Cyril Hrubis
  0 siblings, 1 reply; 8+ messages in thread
From: Petr Vorel @ 2022-09-30  9:12 UTC (permalink / raw)
  To: ltp

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


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-10-10  6:20 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-30  9:12 [LTP] [PATCH v2 1/1] zram01.sh: Fix minimal size for XFS on kernel 5.19 Petr Vorel
2022-09-30  9:21 ` Cyril Hrubis
2022-09-30  9:27   ` Petr Vorel
2022-09-30  9:35     ` Cyril Hrubis
2022-09-30 10:04       ` Petr Vorel
2022-09-30 13:30       ` Petr Vorel
2022-10-09  3:23         ` Li Wang
2022-10-10  6:20           ` Petr Vorel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox