[LTP] [PATCH] file_attr02: Add XFS kernel config requirement

Cyril Hrubis chrubis@suse.cz
Mon Oct 27 10:21:18 CET 2025


Hi!
> > I wonder why tst_get_supported_fs_types() from lib/tst_supported_fs_types.c did
> > not detect it. Could you please post whole output?
> > 
> > Because if code in struct tst_test.filesystems does not work, many tests would
> > be affected with this setup. I'm probably missing something, but I'd prefer to
> > fix the detection in the library than force config (we don't have any CONFIG_.*_FS
> > in testcases/).

I think that we have a but in the test library, it looks like we do not
check for the kernel support if we have only one filesystem defined in
the tst_test.filesystems.

The problem is that we are trying to avoid formatting and mounting the
filesystem for each test iteration (if -i 10 is passed) but that means
that we skip the filesystem kernel support. We only check for mkfs in
the setup and prepare the device.

This should fix it:

diff --git a/lib/tst_test.c b/lib/tst_test.c
index b8894f782..d49f34623 100644
--- a/lib/tst_test.c
+++ b/lib/tst_test.c
@@ -1530,6 +1530,10 @@ static void do_setup(int argc, char *argv[])
                tdev.fs_type = default_fs_type();

                if (!tst_test->all_filesystems && count_fs_descs() <= 1) {
+
+                       if (!tst_fs_is_supported(tdev.fs_type))
+                               tst_brk(TCONF, "The %s filesystem is not supported", tdev.fs_type);
+
                        if (tst_test->filesystems && tst_test->filesystems->mkfs_ver)
                                tst_check_cmd(tst_test->filesystems->mkfs_ver, 1);


-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list