public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH] lib/tst_test: Fix FS kernel supported check
@ 2025-10-27 15:09 Cyril Hrubis
  2025-10-28  3:37 ` Li Wang via ltp
  2025-10-29  8:36 ` Petr Vorel
  0 siblings, 2 replies; 4+ messages in thread
From: Cyril Hrubis @ 2025-10-27 15:09 UTC (permalink / raw)
  To: ltp

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.

Tested-by: Anders Roxell <anders.roxell@linaro.org>
Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
---
 lib/tst_test.c | 4 ++++
 1 file changed, 4 insertions(+)

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);
 
-- 
2.49.1


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

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

* Re: [LTP] [PATCH] lib/tst_test: Fix FS kernel supported check
  2025-10-27 15:09 [LTP] [PATCH] lib/tst_test: Fix FS kernel supported check Cyril Hrubis
@ 2025-10-28  3:37 ` Li Wang via ltp
  2025-10-29  8:36 ` Petr Vorel
  1 sibling, 0 replies; 4+ messages in thread
From: Li Wang via ltp @ 2025-10-28  3:37 UTC (permalink / raw)
  To: Cyril Hrubis; +Cc: ltp

On Mon, Oct 27, 2025 at 11:10 PM Cyril Hrubis <chrubis@suse.cz> wrote:

> 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.
>
> Tested-by: Anders Roxell <anders.roxell@linaro.org>
> Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
>

Reviewed-by: Li Wang <liwang@redhat.com>

---
>  lib/tst_test.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> 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);
>
> --
> 2.49.1
>
>
> --
> Mailing list info: https://lists.linux.it/listinfo/ltp
>
>

-- 
Regards,
Li Wang

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

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

* Re: [LTP] [PATCH] lib/tst_test: Fix FS kernel supported check
  2025-10-27 15:09 [LTP] [PATCH] lib/tst_test: Fix FS kernel supported check Cyril Hrubis
  2025-10-28  3:37 ` Li Wang via ltp
@ 2025-10-29  8:36 ` Petr Vorel
  2025-10-30 18:20   ` Petr Vorel
  1 sibling, 1 reply; 4+ messages in thread
From: Petr Vorel @ 2025-10-29  8:36 UTC (permalink / raw)
  To: Cyril Hrubis; +Cc: ltp

Hi all,

> 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.

> Tested-by: Anders Roxell <anders.roxell@linaro.org>
> Signed-off-by: Cyril Hrubis <chrubis@suse.cz>

Reported-by: Anders Roxell <anders.roxell@linaro.org>
:)

> +++ 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);

Reviewed-by: Petr Vorel <pvorel@suse.cz>
Thanks to both!

Kind regards,
Petr

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

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

* Re: [LTP] [PATCH] lib/tst_test: Fix FS kernel supported check
  2025-10-29  8:36 ` Petr Vorel
@ 2025-10-30 18:20   ` Petr Vorel
  0 siblings, 0 replies; 4+ messages in thread
From: Petr Vorel @ 2025-10-30 18:20 UTC (permalink / raw)
  To: Cyril Hrubis, ltp

Hi all,

I dared to merge the patch.
Thanks to all!

Kind regards,
Petr

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

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

end of thread, other threads:[~2025-10-30 18:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-27 15:09 [LTP] [PATCH] lib/tst_test: Fix FS kernel supported check Cyril Hrubis
2025-10-28  3:37 ` Li Wang via ltp
2025-10-29  8:36 ` Petr Vorel
2025-10-30 18: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