linux-bcachefs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] lib: Add support bcachefs filesystem
@ 2023-11-16 13:55 Petr Vorel
  2023-12-07 14:33 ` Cyril Hrubis
  0 siblings, 1 reply; 5+ messages in thread
From: Petr Vorel @ 2023-11-16 13:55 UTC (permalink / raw)
  To: ltp
  Cc: Petr Vorel, Cyril Hrubis, Li Wang, Richard Palethorpe,
	Jan Stancek, Xiao Yang, Yang Xu, Kent Overstreet, Brian Foster,
	linux-bcachefs, fstests

bcachefs has been merged into v6.7-rc1 [1]. Let's add it's support to
LTP .all_filesystems = 1 and TST_ALL_FILESYSTEMS=1.

[1] https://lwn.net/Articles/934692/

Suggested-by: Cyril Hrubis <chrubis@suse.cz>
Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
Hi,

this should be merged after v6.7 is released.

So far I haven't tested all LTP tests on bcachefs temporary directory.
I have only tested tests which use .all_filesystems = 1 or TST_ALL_FILESYSTEMS=1.
So far it looks like there are only a few tests failing:

statvfs01.c:44: TFAIL: creat(valid_fname, 0444) failed: ENAMETOOLONG (36)

statx04.c:122: TFAIL: STATX_ATTR_COMPRESSED not supported

fanotify13.c, fanotify15.c and fanotify16.c produce many errors.

I haven't tested on machine with more NUMA nodes, thus
set_mempolicy03.c, set_mempolicy04.c has not been tested.

I also looks like preadv2() is not supported (preadv203.c).

Tested on 6.7.0-rc1-2.g86e46c2-default and bcachefs-tools-24-1.3.

Kind regards,
Petr

 lib/tst_supported_fs_types.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/tst_supported_fs_types.c b/lib/tst_supported_fs_types.c
index d4911fa3b..369836717 100644
--- a/lib/tst_supported_fs_types.c
+++ b/lib/tst_supported_fs_types.c
@@ -1,6 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (c) 2017 Cyril Hrubis <chrubis@suse.cz>
+ * Copyright (c) Linux Test Project, 2018-2023
  */
 
 #include <stdio.h>
@@ -24,6 +25,7 @@ static const char *const fs_type_whitelist[] = {
 	"ext4",
 	"xfs",
 	"btrfs",
+	"bcachefs",
 	"vfat",
 	"exfat",
 	"ntfs",
-- 
2.42.0


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

* Re: [PATCH 1/1] lib: Add support bcachefs filesystem
  2023-11-16 13:55 [PATCH 1/1] lib: Add support bcachefs filesystem Petr Vorel
@ 2023-12-07 14:33 ` Cyril Hrubis
  2023-12-07 17:55   ` Petr Vorel
  2023-12-07 19:22   ` Petr Vorel
  0 siblings, 2 replies; 5+ messages in thread
From: Cyril Hrubis @ 2023-12-07 14:33 UTC (permalink / raw)
  To: Petr Vorel
  Cc: ltp, Li Wang, Richard Palethorpe, Jan Stancek, Xiao Yang,
	Yang Xu, Kent Overstreet, Brian Foster, linux-bcachefs, fstests

Hi!
> bcachefs has been merged into v6.7-rc1 [1]. Let's add it's support to
> LTP .all_filesystems = 1 and TST_ALL_FILESYSTEMS=1.
> 
> [1] https://lwn.net/Articles/934692/
> 
> Suggested-by: Cyril Hrubis <chrubis@suse.cz>
> Signed-off-by: Petr Vorel <pvorel@suse.cz>
> ---
> Hi,
> 
> this should be merged after v6.7 is released.

Agreed, although it's unlikey that they will pull bcachefs off from the
tree now. Any way I think that we should add the support to the next
release.

> So far I haven't tested all LTP tests on bcachefs temporary directory.
> I have only tested tests which use .all_filesystems = 1 or TST_ALL_FILESYSTEMS=1.
> So far it looks like there are only a few tests failing:
> 
> statvfs01.c:44: TFAIL: creat(valid_fname, 0444) failed: ENAMETOOLONG (36)

That strange, that would mean that statvfs() reports possibly wrong
f_namemax. Looking at the code the f_namemax is initialized to
BCH_NAME_MAX in bch2_statfs().

And the dirent_create_key() does:

        if (name->len > BCH_NAME_MAX)
                return ERR_PTR(-ENAMETOOLONG);

That does not look like there is any room for a failure. Maybe we can
print the buf.f_namemax value in the test and check if it's 512 since
that is the value of BCH_NAME_MAX.

> statx04.c:122: TFAIL: STATX_ATTR_COMPRESSED not supported

This probably just needs:

diff --git a/testcases/kernel/syscalls/statx/statx04.c b/testcases/kernel/syscalls/statx/statx04.c
index 58296bd24..8d14cef8c 100644
--- a/testcases/kernel/syscalls/statx/statx04.c
+++ b/testcases/kernel/syscalls/statx/statx04.c
@@ -97,7 +97,8 @@ static void setup(void)
                expected_mask |= attr_list[i].attr;

        /* STATX_ATTR_COMPRESSED not supported on XFS, TMPFS */
-       if (!strcmp(tst_device->fs_type, "xfs") || !strcmp(tst_device->fs_type, "tmpfs"))
+       if (!strcmp(tst_device->fs_type, "xfs") || !strcmp(tst_device->fs_type, "tmpfs") ||
+           !strcmp(tst_device->fs_type, "bcachefs")
                expected_mask &= ~STATX_ATTR_COMPRESSED;

        /* Attribute support was added to Btrfs statx() in kernel v4.13 */

> fanotify13.c, fanotify15.c and fanotify16.c produce many errors.

That is probably something for Jan Kara or Amir Goldstein.

> I haven't tested on machine with more NUMA nodes, thus
> set_mempolicy03.c, set_mempolicy04.c has not been tested.

-- 
Cyril Hrubis
chrubis@suse.cz

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

* Re: [PATCH 1/1] lib: Add support bcachefs filesystem
  2023-12-07 14:33 ` Cyril Hrubis
@ 2023-12-07 17:55   ` Petr Vorel
  2024-05-07 17:10     ` [LTP] " Petr Vorel
  2023-12-07 19:22   ` Petr Vorel
  1 sibling, 1 reply; 5+ messages in thread
From: Petr Vorel @ 2023-12-07 17:55 UTC (permalink / raw)
  To: Cyril Hrubis
  Cc: ltp, Li Wang, Richard Palethorpe, Jan Stancek, Xiao Yang,
	Yang Xu, Kent Overstreet, Brian Foster, linux-bcachefs, fstests

> Hi!
> > bcachefs has been merged into v6.7-rc1 [1]. Let's add it's support to
> > LTP .all_filesystems = 1 and TST_ALL_FILESYSTEMS=1.

> > [1] https://lwn.net/Articles/934692/

> > Suggested-by: Cyril Hrubis <chrubis@suse.cz>
> > Signed-off-by: Petr Vorel <pvorel@suse.cz>
> > ---
> > Hi,

> > this should be merged after v6.7 is released.

> Agreed, although it's unlikey that they will pull bcachefs off from the
> tree now. Any way I think that we should add the support to the next
> release.

Yep, now it's 6.7-rc4. I'll prepare v2

> > So far I haven't tested all LTP tests on bcachefs temporary directory.
> > I have only tested tests which use .all_filesystems = 1 or TST_ALL_FILESYSTEMS=1.
> > So far it looks like there are only a few tests failing:

> > statvfs01.c:44: TFAIL: creat(valid_fname, 0444) failed: ENAMETOOLONG (36)

> That strange, that would mean that statvfs() reports possibly wrong
> f_namemax. Looking at the code the f_namemax is initialized to
> BCH_NAME_MAX in bch2_statfs().

> And the dirent_create_key() does:

>         if (name->len > BCH_NAME_MAX)
>                 return ERR_PTR(-ENAMETOOLONG);

> That does not look like there is any room for a failure. Maybe we can
> print the buf.f_namemax value in the test and check if it's 512 since
> that is the value of BCH_NAME_MAX.

> > statx04.c:122: TFAIL: STATX_ATTR_COMPRESSED not supported

> This probably just needs:

> diff --git a/testcases/kernel/syscalls/statx/statx04.c b/testcases/kernel/syscalls/statx/statx04.c
> index 58296bd24..8d14cef8c 100644
> --- a/testcases/kernel/syscalls/statx/statx04.c
> +++ b/testcases/kernel/syscalls/statx/statx04.c
> @@ -97,7 +97,8 @@ static void setup(void)
>                 expected_mask |= attr_list[i].attr;

>         /* STATX_ATTR_COMPRESSED not supported on XFS, TMPFS */
> -       if (!strcmp(tst_device->fs_type, "xfs") || !strcmp(tst_device->fs_type, "tmpfs"))
> +       if (!strcmp(tst_device->fs_type, "xfs") || !strcmp(tst_device->fs_type, "tmpfs") ||
> +           !strcmp(tst_device->fs_type, "bcachefs")
>                 expected_mask &= ~STATX_ATTR_COMPRESSED;

Obviously skipping works. STATX_ATTR_COMPRESSED is not in fs/bcachefs/ directory in stat->attributes,
unlike on the other fs, so it looks like it's not supported.

>         /* Attribute support was added to Btrfs statx() in kernel v4.13 */

> > fanotify13.c, fanotify15.c and fanotify16.c produce many errors.

> That is probably something for Jan Kara or Amir Goldstein.

Yep, I'll Cc them on v2 and ask for help.

Kind regards,
Petr

> > I haven't tested on machine with more NUMA nodes, thus
> > set_mempolicy03.c, set_mempolicy04.c has not been tested.

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

* Re: [PATCH 1/1] lib: Add support bcachefs filesystem
  2023-12-07 14:33 ` Cyril Hrubis
  2023-12-07 17:55   ` Petr Vorel
@ 2023-12-07 19:22   ` Petr Vorel
  1 sibling, 0 replies; 5+ messages in thread
From: Petr Vorel @ 2023-12-07 19:22 UTC (permalink / raw)
  To: Cyril Hrubis
  Cc: ltp, Li Wang, Richard Palethorpe, Jan Stancek, Xiao Yang,
	Yang Xu, Kent Overstreet, Brian Foster, linux-bcachefs, fstests

Hi Cyril, all,

BTW we need to add TST_BCACHE_MAGIC to detect used filesystem.
(BCACHEFS_STATFS_MAGIC       0xca451a4e from fs/bcachefs/bcachefs_format.h)
Will be in v2.

Kind regards,
Petr

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

* Re: [LTP] [PATCH 1/1] lib: Add support bcachefs filesystem
  2023-12-07 17:55   ` Petr Vorel
@ 2024-05-07 17:10     ` Petr Vorel
  0 siblings, 0 replies; 5+ messages in thread
From: Petr Vorel @ 2024-05-07 17:10 UTC (permalink / raw)
  To: Cyril Hrubis, Kent Overstreet, Brian Foster, fstests,
	linux-bcachefs, Richard Palethorpe, ltp

Hi all,

> > Hi!
> > > bcachefs has been merged into v6.7-rc1 [1]. Let's add it's support to
> > > LTP .all_filesystems = 1 and TST_ALL_FILESYSTEMS=1.

> > > [1] https://lwn.net/Articles/934692/

> > > Suggested-by: Cyril Hrubis <chrubis@suse.cz>
> > > Signed-off-by: Petr Vorel <pvorel@suse.cz>
> > > ---
> > > Hi,

> > > this should be merged after v6.7 is released.

> > Agreed, although it's unlikey that they will pull bcachefs off from the
> > tree now. Any way I think that we should add the support to the next
> > release.

> Yep, now it's 6.7-rc4. I'll prepare v2

> > > So far I haven't tested all LTP tests on bcachefs temporary directory.
> > > I have only tested tests which use .all_filesystems = 1 or TST_ALL_FILESYSTEMS=1.
> > > So far it looks like there are only a few tests failing:

> > > statvfs01.c:44: TFAIL: creat(valid_fname, 0444) failed: ENAMETOOLONG (36)

> > That strange, that would mean that statvfs() reports possibly wrong
> > f_namemax. Looking at the code the f_namemax is initialized to
> > BCH_NAME_MAX in bch2_statfs().

> > And the dirent_create_key() does:

> >         if (name->len > BCH_NAME_MAX)
> >                 return ERR_PTR(-ENAMETOOLONG);

> > That does not look like there is any room for a failure. Maybe we can
> > print the buf.f_namemax value in the test and check if it's 512 since
> > that is the value of BCH_NAME_MAX.

FYI Unfortunately ENAMETOOLONG is still problem on statvfs() on bcachefs.

Kind regards,
Petr

...

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

end of thread, other threads:[~2024-05-07 17:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-16 13:55 [PATCH 1/1] lib: Add support bcachefs filesystem Petr Vorel
2023-12-07 14:33 ` Cyril Hrubis
2023-12-07 17:55   ` Petr Vorel
2024-05-07 17:10     ` [LTP] " Petr Vorel
2023-12-07 19:22   ` Petr Vorel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).