[LTP] [PATCH] lib/tst_test: Fix FS kernel supported check

Li Wang liwang@redhat.com
Tue Oct 28 04:37:46 CET 2025


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


More information about the ltp mailing list