[LTP] [PATCH 1/1] safe_macros: Fix bcachefs failure old kernel

Cyril Hrubis chrubis@suse.cz
Wed Jan 17 17:01:33 CET 2024


Hi!
> I'm sorry, although man bcachefs(8) mentions fusemount, I haven't
> figured out how to mount filesystem. Am I missing something?
> 
> Also, maybe for the start I would prefer to to test just kernel
> functionality (no fuse).
 
So this means that mount.bcasefs does exist, but the mount() fails? That
sounds like something wasn't wired up properly.

> Kind regards,
> Petr
> 
>  lib/tst_supported_fs_types.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/lib/tst_supported_fs_types.c b/lib/tst_supported_fs_types.c
> index 369836717..21765c370 100644
> --- a/lib/tst_supported_fs_types.c
> +++ b/lib/tst_supported_fs_types.c
> @@ -96,6 +96,11 @@ static enum tst_fs_impl has_kernel_support(const char *fs_type)
>  
>  	SAFE_RMDIR(template);
>  
> +	if (!strcmp(fs_type, "bcachefs") && tst_kvercmp(6, 7, 0) < 0) {
> +		tst_res(TINFO, "bcachefs skipped on kernel < 6.7");
> +		return TST_FS_UNSUPPORTED;
> +	}

I would rather turn this into a FUSE specific blacklist without a kernel
version, since bcachefs got into the kernel I do not think the fuse
version would be useful for testhing at all, so what about:

diff --git a/lib/tst_supported_fs_types.c b/lib/tst_supported_fs_types.c
index 369836717..4110c826e 100644
--- a/lib/tst_supported_fs_types.c
+++ b/lib/tst_supported_fs_types.c
@@ -33,6 +33,11 @@ static const char *const fs_type_whitelist[] = {
        NULL
 };

+static const cahr *const fs_type_fuse_blacklist[] = {
+       "bcachefs",
+       NULL,
+};
+
 static const char *fs_types[ARRAY_SIZE(fs_type_whitelist)];

 static int has_mkfs(const char *fs_type)
@@ -96,6 +101,11 @@ static enum tst_fs_impl has_kernel_support(const char *fs_type)

        SAFE_RMDIR(template);

+       if (tst_fs_in_skiplist(fs_type, tst_fs_type_fuse_blacklist)) {
+               tst_res("Skipping %s because of FUSE blacklist", fs_type);
+               return TST_FS_UNSUPPORTED;
+       }
+
        /* Is FUSE supported by kernel? */
        if (fuse_supported == -1) {
                ret = open("/dev/fuse", O_RDWR);


>  	/* Is FUSE supported by kernel? */
>  	if (fuse_supported == -1) {
>  		ret = open("/dev/fuse", O_RDWR);

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list