All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: Petr Vorel <pvorel@suse.cz>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v4] lib: LTP_SINGLE_FS_TYPE and LTP_FORCE_SINGLE_FS_TYPE
Date: Tue, 27 May 2025 13:16:55 +0200	[thread overview]
Message-ID: <aDWfJ97gIGTRpMQI@yuki.lan> (raw)
In-Reply-To: <20250527110043.GA186218@pevik>

Hi!
> > That's right, just confirmed with Cyril, so far we need to do nothing
> > unless tst_get_supported_fs_types() is abused somewhere.
> 
> Abusing the function should be prevented if Cyril adds before merge 'static'
> keyword to the function (as I suggested earlier).

That's a different function and that is going to be static in the final
patch.

This is the function that is called from tst_test.c and I guess that we
can remove it from the tst_fs.h in order to make sure nobody tries to
misuse it. That would look like:

diff --git a/include/tst_fs.h b/include/tst_fs.h
index 19c240e07..ceae78e7e 100644
--- a/include/tst_fs.h
+++ b/include/tst_fs.h
@@ -203,13 +203,6 @@ enum tst_fs_impl {
  */
 enum tst_fs_impl tst_fs_is_supported(const char *fs_type);

-/*
- * Returns NULL-terminated array of kernel-supported filesystems.
- *
- * @skiplist A NULL terminated array of filesystems to skip.
- */
-const char **tst_get_supported_fs_types(const char *const *skiplist);
-
 /*
  * Returns 1 if filesystem is in skiplist 0 otherwise.
  *
diff --git a/lib/tst_internal.h b/lib/tst_internal.h
new file mode 100644
index 000000000..a0ae733f6
--- /dev/null
+++ b/lib/tst_internal.h
@@ -0,0 +1,17 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/*
+ * Copyright (c) 2015-2025 Cyril Hrubis <chrubis@suse.cz>
+ * Copyright (c) Linux Test Project, 2017-2025
+ */
+
+#ifndef TST_INTERNAL_H__
+#define TST_INTERNAL_H__
+
+/*
+ * Returns NULL-terminated array of kernel-supported filesystems.
+ *
+ * @skiplist A NULL terminated array of filesystems to skip.
+ */
+const char **tst_get_supported_fs_types(const char *const *skiplist);
+
+#endif /* TST_INTERNAL_H__ */
diff --git a/lib/tst_supported_fs_types.c b/lib/tst_supported_fs_types.c
index 46165ebc6..cc5522a08 100644
--- a/lib/tst_supported_fs_types.c
+++ b/lib/tst_supported_fs_types.c
@@ -14,6 +14,7 @@
 #define TST_NO_DEFAULT_MAIN
 #include "tst_test.h"
 #include "tst_fs.h"
+#include "tst_internal.h"

 /*
  * NOTE: new filesystem should be also added to
diff --git a/lib/tst_test.c b/lib/tst_test.c
index 45fc28498..f62cc195a 100644
--- a/lib/tst_test.c
+++ b/lib/tst_test.c
@@ -38,6 +38,7 @@
 #include "old_device.h"
 #include "old_tmpdir.h"
 #include "ltp-version.h"
+#include "tst_internal.h"

 /*
  * Hack to get TCID defined in newlib tests


-- 
Cyril Hrubis
chrubis@suse.cz

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

  reply	other threads:[~2025-05-27 11:16 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-26 14:34 [LTP] [PATCH v4] lib: LTP_SINGLE_FS_TYPE and LTP_FORCE_SINGLE_FS_TYPE Cyril Hrubis
2025-05-26 15:51 ` Petr Vorel
2025-05-27  8:55   ` Li Wang via ltp
2025-05-28 13:16     ` Cyril Hrubis
2025-05-27  9:07   ` Li Wang via ltp
2025-05-27  9:31     ` Cyril Hrubis
2025-05-27  9:38       ` Li Wang via ltp
2025-05-27  9:42         ` Cyril Hrubis
2025-05-27  9:34     ` Petr Vorel
2025-05-27  9:57       ` Li Wang via ltp
2025-05-27 11:00         ` Petr Vorel
2025-05-27 11:16           ` Cyril Hrubis [this message]
2025-05-27 11:32             ` Petr Vorel
2025-05-27 11:43               ` Cyril Hrubis
2025-05-27 12:04                 ` Petr Vorel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aDWfJ97gIGTRpMQI@yuki.lan \
    --to=chrubis@suse.cz \
    --cc=ltp@lists.linux.it \
    --cc=pvorel@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.