[LTP] [PATCH v10] hugetlb/hugemmap: add hugemmap33 to test hugetlbfs quota accounting

Cyril Hrubis chrubis@suse.cz
Mon Nov 2 16:35:35 CET 2026


Hi!
Pushed with a minor modification, thanks.

Full diff:

diff --git a/testcases/kernel/mem/hugetlb/hugemmap/hugemmap33.c b/testcases/kernel/mem/hugetlb/hugemmap/hugemmap33.c
index 98a8a8a22..ed4fc44a7 100644
--- a/testcases/kernel/mem/hugetlb/hugemmap/hugemmap33.c
+++ b/testcases/kernel/mem/hugetlb/hugemmap/hugemmap33.c
@@ -34,20 +34,15 @@
 static long hpage_size;
 static int quota_mounted;

-static void verify_quota_stat(long tot, long free, long avail)
+static void verify_quota_stat(long total, long free, long avail)
 {
        struct statfs s;

        SAFE_STATFS(MNTPOINT, &s);

-       if ((long)s.f_blocks != tot || (long)s.f_bfree != free || (long)s.f_bavail != avail) {
-               tst_res(TFAIL, "Bad quota counters: total=%li free=%li avail=%li, expected %li %li %li",
-                       (long)s.f_blocks, (long)s.f_bfree, (long)s.f_bavail,
-                       tot, free, avail);
-               return;
-       }
-       tst_res(TPASS, "Quota counters are correct: total=%li free=%li avail=%li",
-               tot, free, avail);
+       TST_EXP_EQ_LI(s.f_blocks, total);
+       TST_EXP_EQ_LI(s.f_bfree, free);
+       TST_EXP_EQ_LI(s.f_bavail, avail);
 }


-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list