public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH 1/1] safe_macros: Fix bcachefs failure old kernel
@ 2024-01-11 15:05 Petr Vorel
  2024-01-11 15:13 ` pvorel
  2024-01-17 16:01 ` Cyril Hrubis
  0 siblings, 2 replies; 4+ messages in thread
From: Petr Vorel @ 2024-01-11 15:05 UTC (permalink / raw)
  To: ltp; +Cc: Kent Overstreet, linux-bcachefs, Brian Foster, fstests

LTP with bcachefs-tools and kernel < 6.7 fails (more tests):

    # LTP_SINGLE_FS_TYPE=bcachefs ./chdir01
    ...
    tst_supported_fs_types.c:57: TINFO: mkfs.bcachefs does exist
    tst_test.c:1669: TINFO: === Testing on bcachefs ===
    tst_test.c:1117: TINFO: Formatting /dev/loop0 with bcachefs opts=''
    extra opts=''
    tst_test.c:1131: TINFO: Mounting /dev/loop0 to
    /tmp/LTP_chdwqhGtZ/mntpoint fstyp=bcachefs flags=0
    tst_test.c:1131: TBROK: mount(/dev/loop0, mntpoint, bcachefs, 0, (nil))
    failed: ENODEV (19)

The problem is that on FUSE support we expect there is FUSE bcachefs
implementation. bcachefs supports fusemount, but let's skip testing atm.

Fixes: 94802606e ("lib: Add support bcachefs filesystem to .all_filesystems")
Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
Hi all,

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

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;
+	}
+
 	/* Is FUSE supported by kernel? */
 	if (fuse_supported == -1) {
 		ret = open("/dev/fuse", O_RDWR);
-- 
2.43.0


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

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

* Re: [LTP] [PATCH 1/1] safe_macros: Fix bcachefs failure old kernel
  2024-01-11 15:05 [LTP] [PATCH 1/1] safe_macros: Fix bcachefs failure old kernel Petr Vorel
@ 2024-01-11 15:13 ` pvorel
  2024-01-17 16:01 ` Cyril Hrubis
  1 sibling, 0 replies; 4+ messages in thread
From: pvorel @ 2024-01-11 15:13 UTC (permalink / raw)
  To: Petr Vorel; +Cc: Kent Overstreet, Brian Foster, fstests, linux-bcachefs, ltp

Hi,

I'm sorry, I haven't updated the subject, it should have been:
"tst_supported_fs_types: Skip bcachefs on old kernel"

Kind regards,
Petr

On 2024-01-11 16:05, Petr Vorel wrote:
> LTP with bcachefs-tools and kernel < 6.7 fails (more tests):
> 
>     # LTP_SINGLE_FS_TYPE=bcachefs ./chdir01
>     ...
>     tst_supported_fs_types.c:57: TINFO: mkfs.bcachefs does exist
>     tst_test.c:1669: TINFO: === Testing on bcachefs ===
>     tst_test.c:1117: TINFO: Formatting /dev/loop0 with bcachefs opts=''
>     extra opts=''
>     tst_test.c:1131: TINFO: Mounting /dev/loop0 to
>     /tmp/LTP_chdwqhGtZ/mntpoint fstyp=bcachefs flags=0
>     tst_test.c:1131: TBROK: mount(/dev/loop0, mntpoint, bcachefs, 0, 
> (nil))
>     failed: ENODEV (19)
> 
> The problem is that on FUSE support we expect there is FUSE bcachefs
> implementation. bcachefs supports fusemount, but let's skip testing 
> atm.
> 
> Fixes: 94802606e ("lib: Add support bcachefs filesystem to 
> .all_filesystems")
> Signed-off-by: Petr Vorel <pvorel@suse.cz>
> ---
> Hi all,
> 
> 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).
> 
> 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;
> +	}
> +
>  	/* Is FUSE supported by kernel? */
>  	if (fuse_supported == -1) {
>  		ret = open("/dev/fuse", O_RDWR);

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

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

* Re: [LTP] [PATCH 1/1] safe_macros: Fix bcachefs failure old kernel
  2024-01-11 15:05 [LTP] [PATCH 1/1] safe_macros: Fix bcachefs failure old kernel Petr Vorel
  2024-01-11 15:13 ` pvorel
@ 2024-01-17 16:01 ` Cyril Hrubis
  2024-01-17 20:53   ` Petr Vorel
  1 sibling, 1 reply; 4+ messages in thread
From: Cyril Hrubis @ 2024-01-17 16:01 UTC (permalink / raw)
  To: Petr Vorel; +Cc: Kent Overstreet, Brian Foster, fstests, linux-bcachefs, ltp

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

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

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

* Re: [LTP] [PATCH 1/1] safe_macros: Fix bcachefs failure old kernel
  2024-01-17 16:01 ` Cyril Hrubis
@ 2024-01-17 20:53   ` Petr Vorel
  0 siblings, 0 replies; 4+ messages in thread
From: Petr Vorel @ 2024-01-17 20:53 UTC (permalink / raw)
  To: Cyril Hrubis; +Cc: Kent Overstreet, Brian Foster, fstests, linux-bcachefs, ltp

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

Yes, mount.bcasefs exists, at least on openSUSE Tumbleweed (I suppose elsewhere
as well). Everything is done by single binary bcachefs.

ls -la /sbin/* |grep bcachefs
-rwxr-xr-x 1 root root     1424080 Jan  9 15:00 /sbin/bcachefs
lrwxrwxrwx 1 root root           8 Jan  9 15:00 /sbin/fsck.bcachefs -> bcachefs
lrwxrwxrwx 1 root root           8 Jan  9 15:00 /sbin/fsck.fuse.bcachefs -> bcachefs
lrwxrwxrwx 1 root root           8 Jan  9 15:00 /sbin/mkfs.bcachefs -> bcachefs
lrwxrwxrwx 1 root root           8 Jan  9 15:00 /sbin/mkfs.fuse.bcachefs -> bcachefs
lrwxrwxrwx 1 root root           8 Jan  9 15:00 /sbin/mount.bcachefs -> bcachefs
lrwxrwxrwx 1 root root           8 Jan  9 15:00 /sbin/mount.fuse.bcachefs -> bcachefs

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

Your code makes sense, I'll test it.

Kind regards,
Petr

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

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

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

end of thread, other threads:[~2024-01-17 20:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-11 15:05 [LTP] [PATCH 1/1] safe_macros: Fix bcachefs failure old kernel Petr Vorel
2024-01-11 15:13 ` pvorel
2024-01-17 16:01 ` Cyril Hrubis
2024-01-17 20:53   ` Petr Vorel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox