Skip to contentSkip to conversation

lib/tst_test: Fix FS kernel supported check

PATCH In review Cyril Hrubis 3 participants 4 messages Oct 27, 2025 – Oct 30, 2025 Library code

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 lib/tst_test: Fix FS kernel supported check

In case that there is only single filesystem defined in tst_test.filesystems we format the device in the setup rather in the function that iterates over all filesystems. However we missed a check if a filesystem is supported in this shortcut, hence if mkfs for the filesystem was installed and kernel support was missing the test failed when it attempted to mount the filesystem.

---
 lib/tst_test.c | 4 ++++
 1 file changed, 4 insertions(+)
lib/tst_test.c +4 -0
index b8894f782..d49f34623 100644
@@ -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);
 
Signature · 5 lines
2.49.1


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
Reviewed-by Li Wang on v1 1/1
#1 lore raw
Quoted 10 lines · Cyril Hrubis

In case that there is only single filesystem defined in tst_test.filesystems we format the device in the setup rather in the function that iterates over all filesystems. However we missed a check if a filesystem is supported in this shortcut, hence if mkfs for the filesystem was installed and kernel support was missing the test failed when it attempted to mount the filesystem.

---

Quoted 29 lines
 lib/tst_test.c | 4 ++++
 1 file changed, 4 insertions(+)
lib/tst_test.c +4 -0
index b8894f782..d49f34623 100644
@@ -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);

--
2.49.1

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

Signature · 5 lines
Regards,
Li Wang

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
Reviewed-by on v1 1/1
#2 lore raw
In reply to Cyril Hrubis

Hi all,

Quoted 9 lines

In case that there is only single filesystem defined in tst_test.filesystems we format the device in the setup rather in the function that iterates over all filesystems. However we missed a check if a filesystem is supported in this shortcut, hence if mkfs for the filesystem was installed and kernel support was missing the test failed when it attempted to mount the filesystem.

:)

lib/tst_test.c static void do_setup(int argc, char *argv[]) · line 1535

Quoted 8 lines

+++ b/lib/tst_test.c

lib/tst_test.c +3 -0
@@ -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);

Thanks to both!

Kind regards,
Petr

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
#3 lore raw

Hi all,

I dared to merge the patch.
Thanks to all!

Kind regards,
Petr

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp