* [PATCH v3] selinux-testsuite: Add btrfs support for filesystem tests
@ 2025-10-07 18:35 Stephen Smalley
2025-10-07 18:46 ` Stephen Smalley
2025-10-07 19:28 ` Paul Moore
0 siblings, 2 replies; 9+ messages in thread
From: Stephen Smalley @ 2025-10-07 18:35 UTC (permalink / raw)
To: selinux; +Cc: paul, omosnace, Richard Haines, Stephen Smalley
From: Richard Haines <richard_c_haines@btinternet.com>
This allows btrfs filesystems to be created to support the
filesystem mount(2) type calls and the fs_filesystem fsmount(2)
type calls.
Signed-off-by: Richard Haines <richard_c_haines@btinternet.com>
Signed-off-by: Stephen Smalley <stephen.smalley.work@gmail.com>
---
README.md | 2 ++
defconfig | 5 +++++
tests/Makefile | 2 +-
tests/filesystem/Filesystem.pm | 3 +++
tests/filesystem/btrfs | 1 +
tests/filesystem/test | 6 ++++++
tests/fs_filesystem/btrfs | 1 +
tests/fs_filesystem/test | 6 ++++++
8 files changed, 25 insertions(+), 1 deletion(-)
create mode 120000 tests/filesystem/btrfs
create mode 120000 tests/fs_filesystem/btrfs
diff --git a/README.md b/README.md
index f067eeb..973028e 100644
--- a/README.md
+++ b/README.md
@@ -61,6 +61,7 @@ similar dependencies):
* e2fsprogs _(used by the ext4 filesystem tests)_
* jfsutils _(used by the jfs filesystem tests)_
* dosfstools _(used by the vfat filesystem tests)_
+* btrfs-progs _(used by the btrfs filesystem tests)_
* nftables _(used by inet_socket and sctp tests if ver >= 9.3 for secmark testing )_
* rdma-core-devel _(to build the `ibpkey` test program)_
@@ -136,6 +137,7 @@ command:
e2fsprogs \
jfsutils \
dosfstools \
+ btrfs-progs \
nftables \
netlabel-tools \
libibverbs-dev
diff --git a/defconfig b/defconfig
index b2d4a90..214eb26 100644
--- a/defconfig
+++ b/defconfig
@@ -122,6 +122,11 @@ CONFIG_XFS_QUOTA=y
CONFIG_VFAT_FS=m
CONFIG_FAT_DEFAULT_IOCHARSET="ascii"
+
+# Test BTRFS filesystem.
+# This is not required for SELinux operation itself.
+CONFIG_BTRFS_FS=y
+
# watch_queue for key changes.
# They are not required for SELinux operation itself.
CONFIG_WATCH_QUEUE=y
diff --git a/tests/Makefile b/tests/Makefile
index 903ab11..f002389 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -4,7 +4,7 @@ SBINDIR ?= $(PREFIX)/sbin
POLDEV ?= $(PREFIX)/share/selinux/devel
INCLUDEDIR ?= $(PREFIX)/include
SELINUXFS ?= /sys/fs/selinux
-FILESYSTEMS ?= ext4 xfs jfs vfat
+FILESYSTEMS ?= ext4 xfs jfs vfat btrfs
export CFLAGS+=-g -O0 -Wall -D_GNU_SOURCE
diff --git a/tests/filesystem/Filesystem.pm b/tests/filesystem/Filesystem.pm
index f169464..7ea9031 100644
--- a/tests/filesystem/Filesystem.pm
+++ b/tests/filesystem/Filesystem.pm
@@ -123,6 +123,9 @@ sub attach_dev {
sub make_fs {
my ( $mk_type, $mk_dev, $mk_dir, $mk_opts ) = @_;
my $mk_size = 16;
+ if ( $mk_type eq "btrfs" ) {
+ $mk_size = 300;
+ }
if ( $mk_type eq "xfs" ) {
$mk_size = 300;
}
diff --git a/tests/filesystem/btrfs b/tests/filesystem/btrfs
new file mode 120000
index 0000000..945c9b4
--- /dev/null
+++ b/tests/filesystem/btrfs
@@ -0,0 +1 @@
+.
\ No newline at end of file
diff --git a/tests/filesystem/test b/tests/filesystem/test
index a7d8b24..56f116a 100755
--- a/tests/filesystem/test
+++ b/tests/filesystem/test
@@ -89,6 +89,12 @@ BEGIN {
$test_count = 55;
$quota_checks = 0;
}
+
+ # BTRFS uses internal quotas requiring no security hooks
+ elsif ( $fs_type eq "btrfs" ) {
+ $test_count = 55;
+ $quota_checks = 0;
+ }
else {
$test_count = 69;
}
diff --git a/tests/fs_filesystem/btrfs b/tests/fs_filesystem/btrfs
new file mode 120000
index 0000000..945c9b4
--- /dev/null
+++ b/tests/fs_filesystem/btrfs
@@ -0,0 +1 @@
+.
\ No newline at end of file
diff --git a/tests/fs_filesystem/test b/tests/fs_filesystem/test
index 9af8971..1d04bbc 100755
--- a/tests/fs_filesystem/test
+++ b/tests/fs_filesystem/test
@@ -92,6 +92,12 @@ BEGIN {
$test_count = 54;
$quota_checks = 0;
}
+
+ # BTRFS uses internal quotas requiring no security hooks
+ elsif ( $fs_type eq "btrfs" ) {
+ $test_count = 54;
+ $quota_checks = 0;
+ }
else {
$test_count = 68;
}
--
2.51.0
^ permalink raw reply related [flat|nested] 9+ messages in thread* Re: [PATCH v3] selinux-testsuite: Add btrfs support for filesystem tests
2025-10-07 18:35 [PATCH v3] selinux-testsuite: Add btrfs support for filesystem tests Stephen Smalley
@ 2025-10-07 18:46 ` Stephen Smalley
2025-10-07 19:14 ` Stephen Smalley
2025-10-07 19:28 ` Paul Moore
1 sibling, 1 reply; 9+ messages in thread
From: Stephen Smalley @ 2025-10-07 18:46 UTC (permalink / raw)
To: selinux; +Cc: paul, omosnace, Richard Haines
On Tue, Oct 7, 2025 at 2:37 PM Stephen Smalley
<stephen.smalley.work@gmail.com> wrote:
>
> From: Richard Haines <richard_c_haines@btinternet.com>
>
> This allows btrfs filesystems to be created to support the
> filesystem mount(2) type calls and the fs_filesystem fsmount(2)
> type calls.
>
> Signed-off-by: Richard Haines <richard_c_haines@btinternet.com>
> Signed-off-by: Stephen Smalley <stephen.smalley.work@gmail.com>
FYI, these tests pass cleanly for me on a current kernel.
> ---
> README.md | 2 ++
> defconfig | 5 +++++
> tests/Makefile | 2 +-
> tests/filesystem/Filesystem.pm | 3 +++
> tests/filesystem/btrfs | 1 +
> tests/filesystem/test | 6 ++++++
> tests/fs_filesystem/btrfs | 1 +
> tests/fs_filesystem/test | 6 ++++++
> 8 files changed, 25 insertions(+), 1 deletion(-)
> create mode 120000 tests/filesystem/btrfs
> create mode 120000 tests/fs_filesystem/btrfs
>
> diff --git a/README.md b/README.md
> index f067eeb..973028e 100644
> --- a/README.md
> +++ b/README.md
> @@ -61,6 +61,7 @@ similar dependencies):
> * e2fsprogs _(used by the ext4 filesystem tests)_
> * jfsutils _(used by the jfs filesystem tests)_
> * dosfstools _(used by the vfat filesystem tests)_
> +* btrfs-progs _(used by the btrfs filesystem tests)_
> * nftables _(used by inet_socket and sctp tests if ver >= 9.3 for secmark testing )_
> * rdma-core-devel _(to build the `ibpkey` test program)_
>
> @@ -136,6 +137,7 @@ command:
> e2fsprogs \
> jfsutils \
> dosfstools \
> + btrfs-progs \
> nftables \
> netlabel-tools \
> libibverbs-dev
> diff --git a/defconfig b/defconfig
> index b2d4a90..214eb26 100644
> --- a/defconfig
> +++ b/defconfig
> @@ -122,6 +122,11 @@ CONFIG_XFS_QUOTA=y
> CONFIG_VFAT_FS=m
> CONFIG_FAT_DEFAULT_IOCHARSET="ascii"
>
> +
> +# Test BTRFS filesystem.
> +# This is not required for SELinux operation itself.
> +CONFIG_BTRFS_FS=y
> +
> # watch_queue for key changes.
> # They are not required for SELinux operation itself.
> CONFIG_WATCH_QUEUE=y
> diff --git a/tests/Makefile b/tests/Makefile
> index 903ab11..f002389 100644
> --- a/tests/Makefile
> +++ b/tests/Makefile
> @@ -4,7 +4,7 @@ SBINDIR ?= $(PREFIX)/sbin
> POLDEV ?= $(PREFIX)/share/selinux/devel
> INCLUDEDIR ?= $(PREFIX)/include
> SELINUXFS ?= /sys/fs/selinux
> -FILESYSTEMS ?= ext4 xfs jfs vfat
> +FILESYSTEMS ?= ext4 xfs jfs vfat btrfs
>
> export CFLAGS+=-g -O0 -Wall -D_GNU_SOURCE
>
> diff --git a/tests/filesystem/Filesystem.pm b/tests/filesystem/Filesystem.pm
> index f169464..7ea9031 100644
> --- a/tests/filesystem/Filesystem.pm
> +++ b/tests/filesystem/Filesystem.pm
> @@ -123,6 +123,9 @@ sub attach_dev {
> sub make_fs {
> my ( $mk_type, $mk_dev, $mk_dir, $mk_opts ) = @_;
> my $mk_size = 16;
> + if ( $mk_type eq "btrfs" ) {
> + $mk_size = 300;
> + }
> if ( $mk_type eq "xfs" ) {
> $mk_size = 300;
> }
> diff --git a/tests/filesystem/btrfs b/tests/filesystem/btrfs
> new file mode 120000
> index 0000000..945c9b4
> --- /dev/null
> +++ b/tests/filesystem/btrfs
> @@ -0,0 +1 @@
> +.
> \ No newline at end of file
> diff --git a/tests/filesystem/test b/tests/filesystem/test
> index a7d8b24..56f116a 100755
> --- a/tests/filesystem/test
> +++ b/tests/filesystem/test
> @@ -89,6 +89,12 @@ BEGIN {
> $test_count = 55;
> $quota_checks = 0;
> }
> +
> + # BTRFS uses internal quotas requiring no security hooks
> + elsif ( $fs_type eq "btrfs" ) {
> + $test_count = 55;
> + $quota_checks = 0;
> + }
> else {
> $test_count = 69;
> }
> diff --git a/tests/fs_filesystem/btrfs b/tests/fs_filesystem/btrfs
> new file mode 120000
> index 0000000..945c9b4
> --- /dev/null
> +++ b/tests/fs_filesystem/btrfs
> @@ -0,0 +1 @@
> +.
> \ No newline at end of file
> diff --git a/tests/fs_filesystem/test b/tests/fs_filesystem/test
> index 9af8971..1d04bbc 100755
> --- a/tests/fs_filesystem/test
> +++ b/tests/fs_filesystem/test
> @@ -92,6 +92,12 @@ BEGIN {
> $test_count = 54;
> $quota_checks = 0;
> }
> +
> + # BTRFS uses internal quotas requiring no security hooks
> + elsif ( $fs_type eq "btrfs" ) {
> + $test_count = 54;
> + $quota_checks = 0;
> + }
> else {
> $test_count = 68;
> }
> --
> 2.51.0
>
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: [PATCH v3] selinux-testsuite: Add btrfs support for filesystem tests
2025-10-07 18:46 ` Stephen Smalley
@ 2025-10-07 19:14 ` Stephen Smalley
2025-10-07 19:33 ` Paul Moore
0 siblings, 1 reply; 9+ messages in thread
From: Stephen Smalley @ 2025-10-07 19:14 UTC (permalink / raw)
To: selinux; +Cc: paul, omosnace, Richard Haines
On Tue, Oct 7, 2025 at 2:46 PM Stephen Smalley
<stephen.smalley.work@gmail.com> wrote:
>
> On Tue, Oct 7, 2025 at 2:37 PM Stephen Smalley
> <stephen.smalley.work@gmail.com> wrote:
> >
> > From: Richard Haines <richard_c_haines@btinternet.com>
> >
> > This allows btrfs filesystems to be created to support the
> > filesystem mount(2) type calls and the fs_filesystem fsmount(2)
> > type calls.
> >
> > Signed-off-by: Richard Haines <richard_c_haines@btinternet.com>
> > Signed-off-by: Stephen Smalley <stephen.smalley.work@gmail.com>
>
> FYI, these tests pass cleanly for me on a current kernel.
>
> > ---
> > README.md | 2 ++
> > defconfig | 5 +++++
> > tests/Makefile | 2 +-
> > tests/filesystem/Filesystem.pm | 3 +++
> > tests/filesystem/btrfs | 1 +
> > tests/filesystem/test | 6 ++++++
> > tests/fs_filesystem/btrfs | 1 +
> > tests/fs_filesystem/test | 6 ++++++
> > 8 files changed, 25 insertions(+), 1 deletion(-)
> > create mode 120000 tests/filesystem/btrfs
> > create mode 120000 tests/fs_filesystem/btrfs
> >
> > diff --git a/README.md b/README.md
> > index f067eeb..973028e 100644
> > --- a/README.md
> > +++ b/README.md
> > @@ -61,6 +61,7 @@ similar dependencies):
> > * e2fsprogs _(used by the ext4 filesystem tests)_
> > * jfsutils _(used by the jfs filesystem tests)_
> > * dosfstools _(used by the vfat filesystem tests)_
> > +* btrfs-progs _(used by the btrfs filesystem tests)_
> > * nftables _(used by inet_socket and sctp tests if ver >= 9.3 for secmark testing )_
> > * rdma-core-devel _(to build the `ibpkey` test program)_
> >
> > @@ -136,6 +137,7 @@ command:
> > e2fsprogs \
> > jfsutils \
> > dosfstools \
> > + btrfs-progs \
> > nftables \
> > netlabel-tools \
> > libibverbs-dev
> > diff --git a/defconfig b/defconfig
> > index b2d4a90..214eb26 100644
> > --- a/defconfig
> > +++ b/defconfig
> > @@ -122,6 +122,11 @@ CONFIG_XFS_QUOTA=y
> > CONFIG_VFAT_FS=m
> > CONFIG_FAT_DEFAULT_IOCHARSET="ascii"
> >
> > +
> > +# Test BTRFS filesystem.
> > +# This is not required for SELinux operation itself.
> > +CONFIG_BTRFS_FS=y
> > +
> > # watch_queue for key changes.
> > # They are not required for SELinux operation itself.
> > CONFIG_WATCH_QUEUE=y
> > diff --git a/tests/Makefile b/tests/Makefile
> > index 903ab11..f002389 100644
> > --- a/tests/Makefile
> > +++ b/tests/Makefile
> > @@ -4,7 +4,7 @@ SBINDIR ?= $(PREFIX)/sbin
> > POLDEV ?= $(PREFIX)/share/selinux/devel
> > INCLUDEDIR ?= $(PREFIX)/include
> > SELINUXFS ?= /sys/fs/selinux
> > -FILESYSTEMS ?= ext4 xfs jfs vfat
> > +FILESYSTEMS ?= ext4 xfs jfs vfat btrfs
> >
> > export CFLAGS+=-g -O0 -Wall -D_GNU_SOURCE
> >
> > diff --git a/tests/filesystem/Filesystem.pm b/tests/filesystem/Filesystem.pm
> > index f169464..7ea9031 100644
> > --- a/tests/filesystem/Filesystem.pm
> > +++ b/tests/filesystem/Filesystem.pm
> > @@ -123,6 +123,9 @@ sub attach_dev {
> > sub make_fs {
> > my ( $mk_type, $mk_dev, $mk_dir, $mk_opts ) = @_;
> > my $mk_size = 16;
> > + if ( $mk_type eq "btrfs" ) {
> > + $mk_size = 300;
Looks like I could drop this down to 109 if we care. 109M == 114294784
bytes is the smallest supported size reported by mkfs.btrfs. I don't
know how stable that value remains across different versions or how it
was derived.
> > + }
> > if ( $mk_type eq "xfs" ) {
> > $mk_size = 300;
> > }
> > diff --git a/tests/filesystem/btrfs b/tests/filesystem/btrfs
> > new file mode 120000
> > index 0000000..945c9b4
> > --- /dev/null
> > +++ b/tests/filesystem/btrfs
> > @@ -0,0 +1 @@
> > +.
> > \ No newline at end of file
> > diff --git a/tests/filesystem/test b/tests/filesystem/test
> > index a7d8b24..56f116a 100755
> > --- a/tests/filesystem/test
> > +++ b/tests/filesystem/test
> > @@ -89,6 +89,12 @@ BEGIN {
> > $test_count = 55;
> > $quota_checks = 0;
> > }
> > +
> > + # BTRFS uses internal quotas requiring no security hooks
> > + elsif ( $fs_type eq "btrfs" ) {
> > + $test_count = 55;
> > + $quota_checks = 0;
> > + }
> > else {
> > $test_count = 69;
> > }
> > diff --git a/tests/fs_filesystem/btrfs b/tests/fs_filesystem/btrfs
> > new file mode 120000
> > index 0000000..945c9b4
> > --- /dev/null
> > +++ b/tests/fs_filesystem/btrfs
> > @@ -0,0 +1 @@
> > +.
> > \ No newline at end of file
> > diff --git a/tests/fs_filesystem/test b/tests/fs_filesystem/test
> > index 9af8971..1d04bbc 100755
> > --- a/tests/fs_filesystem/test
> > +++ b/tests/fs_filesystem/test
> > @@ -92,6 +92,12 @@ BEGIN {
> > $test_count = 54;
> > $quota_checks = 0;
> > }
> > +
> > + # BTRFS uses internal quotas requiring no security hooks
> > + elsif ( $fs_type eq "btrfs" ) {
> > + $test_count = 54;
> > + $quota_checks = 0;
> > + }
> > else {
> > $test_count = 68;
> > }
> > --
> > 2.51.0
> >
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: [PATCH v3] selinux-testsuite: Add btrfs support for filesystem tests
2025-10-07 19:14 ` Stephen Smalley
@ 2025-10-07 19:33 ` Paul Moore
2025-10-07 19:50 ` Stephen Smalley
0 siblings, 1 reply; 9+ messages in thread
From: Paul Moore @ 2025-10-07 19:33 UTC (permalink / raw)
To: Stephen Smalley; +Cc: selinux, omosnace, Richard Haines
On Tue, Oct 7, 2025 at 3:14 PM Stephen Smalley
<stephen.smalley.work@gmail.com> wrote:
> On Tue, Oct 7, 2025 at 2:46 PM Stephen Smalley
> <stephen.smalley.work@gmail.com> wrote:
> > On Tue, Oct 7, 2025 at 2:37 PM Stephen Smalley
> > <stephen.smalley.work@gmail.com> wrote:
> > >
> > > From: Richard Haines <richard_c_haines@btinternet.com>
> > >
> > > This allows btrfs filesystems to be created to support the
> > > filesystem mount(2) type calls and the fs_filesystem fsmount(2)
> > > type calls.
> > >
> > > Signed-off-by: Richard Haines <richard_c_haines@btinternet.com>
> > > Signed-off-by: Stephen Smalley <stephen.smalley.work@gmail.com>
> >
> > FYI, these tests pass cleanly for me on a current kernel.
> >
> > > ---
> > > README.md | 2 ++
> > > defconfig | 5 +++++
> > > tests/Makefile | 2 +-
> > > tests/filesystem/Filesystem.pm | 3 +++
> > > tests/filesystem/btrfs | 1 +
> > > tests/filesystem/test | 6 ++++++
> > > tests/fs_filesystem/btrfs | 1 +
> > > tests/fs_filesystem/test | 6 ++++++
> > > 8 files changed, 25 insertions(+), 1 deletion(-)
> > > create mode 120000 tests/filesystem/btrfs
> > > create mode 120000 tests/fs_filesystem/btrfs
...
> > > diff --git a/tests/filesystem/Filesystem.pm b/tests/filesystem/Filesystem.pm
> > > index f169464..7ea9031 100644
> > > --- a/tests/filesystem/Filesystem.pm
> > > +++ b/tests/filesystem/Filesystem.pm
> > > @@ -123,6 +123,9 @@ sub attach_dev {
> > > sub make_fs {
> > > my ( $mk_type, $mk_dev, $mk_dir, $mk_opts ) = @_;
> > > my $mk_size = 16;
> > > + if ( $mk_type eq "btrfs" ) {
> > > + $mk_size = 300;
>
> Looks like I could drop this down to 109 if we care. 109M == 114294784
> bytes is the smallest supported size reported by mkfs.btrfs. I don't
> know how stable that value remains across different versions or how it
> was derived.
I'd be worried about tests failing at some point in the future if they
are running right at the limit. Did you find 300 to be problematic in
some way, e.g. excessively slow?
Assuming the exact number is arbitrary, as long as the minimum is met,
we could always make it a little smaller while keeping it to a power
of two, e.g. 128.
--
paul-moore.com
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: [PATCH v3] selinux-testsuite: Add btrfs support for filesystem tests
2025-10-07 19:33 ` Paul Moore
@ 2025-10-07 19:50 ` Stephen Smalley
2025-10-07 19:59 ` Paul Moore
0 siblings, 1 reply; 9+ messages in thread
From: Stephen Smalley @ 2025-10-07 19:50 UTC (permalink / raw)
To: Paul Moore; +Cc: selinux, omosnace, Richard Haines
On Tue, Oct 7, 2025 at 3:33 PM Paul Moore <paul@paul-moore.com> wrote:
>
> On Tue, Oct 7, 2025 at 3:14 PM Stephen Smalley
> <stephen.smalley.work@gmail.com> wrote:
> > On Tue, Oct 7, 2025 at 2:46 PM Stephen Smalley
> > <stephen.smalley.work@gmail.com> wrote:
> > > On Tue, Oct 7, 2025 at 2:37 PM Stephen Smalley
> > > <stephen.smalley.work@gmail.com> wrote:
> > > >
> > > > From: Richard Haines <richard_c_haines@btinternet.com>
> > > >
> > > > This allows btrfs filesystems to be created to support the
> > > > filesystem mount(2) type calls and the fs_filesystem fsmount(2)
> > > > type calls.
> > > >
> > > > Signed-off-by: Richard Haines <richard_c_haines@btinternet.com>
> > > > Signed-off-by: Stephen Smalley <stephen.smalley.work@gmail.com>
> > >
> > > FYI, these tests pass cleanly for me on a current kernel.
> > >
> > > > ---
> > > > README.md | 2 ++
> > > > defconfig | 5 +++++
> > > > tests/Makefile | 2 +-
> > > > tests/filesystem/Filesystem.pm | 3 +++
> > > > tests/filesystem/btrfs | 1 +
> > > > tests/filesystem/test | 6 ++++++
> > > > tests/fs_filesystem/btrfs | 1 +
> > > > tests/fs_filesystem/test | 6 ++++++
> > > > 8 files changed, 25 insertions(+), 1 deletion(-)
> > > > create mode 120000 tests/filesystem/btrfs
> > > > create mode 120000 tests/fs_filesystem/btrfs
>
> ...
>
> > > > diff --git a/tests/filesystem/Filesystem.pm b/tests/filesystem/Filesystem.pm
> > > > index f169464..7ea9031 100644
> > > > --- a/tests/filesystem/Filesystem.pm
> > > > +++ b/tests/filesystem/Filesystem.pm
> > > > @@ -123,6 +123,9 @@ sub attach_dev {
> > > > sub make_fs {
> > > > my ( $mk_type, $mk_dev, $mk_dir, $mk_opts ) = @_;
> > > > my $mk_size = 16;
> > > > + if ( $mk_type eq "btrfs" ) {
> > > > + $mk_size = 300;
> >
> > Looks like I could drop this down to 109 if we care. 109M == 114294784
> > bytes is the smallest supported size reported by mkfs.btrfs. I don't
> > know how stable that value remains across different versions or how it
> > was derived.
>
> I'd be worried about tests failing at some point in the future if they
> are running right at the limit. Did you find 300 to be problematic in
> some way, e.g. excessively slow?
No, it wasn't excessively slow as far as I noticed - no more so than usual.
300M is the min size for xfs so I just reused it here.
> Assuming the exact number is arbitrary, as long as the minimum is met,
> we could always make it a little smaller while keeping it to a power
> of two, e.g. 128.
Yep, can make it that too if desired.
>
> --
> paul-moore.com
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: [PATCH v3] selinux-testsuite: Add btrfs support for filesystem tests
2025-10-07 19:50 ` Stephen Smalley
@ 2025-10-07 19:59 ` Paul Moore
0 siblings, 0 replies; 9+ messages in thread
From: Paul Moore @ 2025-10-07 19:59 UTC (permalink / raw)
To: Stephen Smalley; +Cc: selinux, omosnace, Richard Haines
On Tue, Oct 7, 2025 at 3:50 PM Stephen Smalley
<stephen.smalley.work@gmail.com> wrote:
> On Tue, Oct 7, 2025 at 3:33 PM Paul Moore <paul@paul-moore.com> wrote:
> > On Tue, Oct 7, 2025 at 3:14 PM Stephen Smalley
> > <stephen.smalley.work@gmail.com> wrote:
> > > On Tue, Oct 7, 2025 at 2:46 PM Stephen Smalley
> > > <stephen.smalley.work@gmail.com> wrote:
> > > > On Tue, Oct 7, 2025 at 2:37 PM Stephen Smalley
> > > > <stephen.smalley.work@gmail.com> wrote:
...
> > > > > diff --git a/tests/filesystem/Filesystem.pm b/tests/filesystem/Filesystem.pm
> > > > > index f169464..7ea9031 100644
> > > > > --- a/tests/filesystem/Filesystem.pm
> > > > > +++ b/tests/filesystem/Filesystem.pm
> > > > > @@ -123,6 +123,9 @@ sub attach_dev {
> > > > > sub make_fs {
> > > > > my ( $mk_type, $mk_dev, $mk_dir, $mk_opts ) = @_;
> > > > > my $mk_size = 16;
> > > > > + if ( $mk_type eq "btrfs" ) {
> > > > > + $mk_size = 300;
> > >
> > > Looks like I could drop this down to 109 if we care. 109M == 114294784
> > > bytes is the smallest supported size reported by mkfs.btrfs. I don't
> > > know how stable that value remains across different versions or how it
> > > was derived.
> >
> > I'd be worried about tests failing at some point in the future if they
> > are running right at the limit. Did you find 300 to be problematic in
> > some way, e.g. excessively slow?
>
> No, it wasn't excessively slow as far as I noticed - no more so than usual.
> 300M is the min size for xfs so I just reused it here.
As long as it's not a problem, I've got no real preference. If there
is some way to simplify the test code by adopting a common lowest
acceptable fs fize that would probably be worthwhile, but I wouldn't
bother too much with that.
Ultimately this is up to Ondrej if/when he sees this patch again.
> > Assuming the exact number is arbitrary, as long as the minimum is met,
> > we could always make it a little smaller while keeping it to a power
> > of two, e.g. 128.
>
> Yep, can make it that too if desired.
--
paul-moore.com
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v3] selinux-testsuite: Add btrfs support for filesystem tests
2025-10-07 18:35 [PATCH v3] selinux-testsuite: Add btrfs support for filesystem tests Stephen Smalley
2025-10-07 18:46 ` Stephen Smalley
@ 2025-10-07 19:28 ` Paul Moore
2025-10-07 19:47 ` Stephen Smalley
1 sibling, 1 reply; 9+ messages in thread
From: Paul Moore @ 2025-10-07 19:28 UTC (permalink / raw)
To: Stephen Smalley; +Cc: selinux, omosnace, Richard Haines
On Tue, Oct 7, 2025 at 2:37 PM Stephen Smalley
<stephen.smalley.work@gmail.com> wrote:
>
> From: Richard Haines <richard_c_haines@btinternet.com>
>
> This allows btrfs filesystems to be created to support the
> filesystem mount(2) type calls and the fs_filesystem fsmount(2)
> type calls.
>
> Signed-off-by: Richard Haines <richard_c_haines@btinternet.com>
> Signed-off-by: Stephen Smalley <stephen.smalley.work@gmail.com>
> ---
> README.md | 2 ++
> defconfig | 5 +++++
> tests/Makefile | 2 +-
> tests/filesystem/Filesystem.pm | 3 +++
> tests/filesystem/btrfs | 1 +
> tests/filesystem/test | 6 ++++++
> tests/fs_filesystem/btrfs | 1 +
> tests/fs_filesystem/test | 6 ++++++
> 8 files changed, 25 insertions(+), 1 deletion(-)
> create mode 120000 tests/filesystem/btrfs
> create mode 120000 tests/fs_filesystem/btrfs
...
> diff --git a/tests/filesystem/btrfs b/tests/filesystem/btrfs
> new file mode 120000
> index 0000000..945c9b4
> --- /dev/null
> +++ b/tests/filesystem/btrfs
> @@ -0,0 +1 @@
> +.
> \ No newline at end of file
This, and the similar file below, look odd to me. I only looked very
quickly, but I don't see any references to these files in the rest of
this patchset, is their inclusion in this patch a mistake, or am I
missing something?
> diff --git a/tests/fs_filesystem/btrfs b/tests/fs_filesystem/btrfs
> new file mode 120000
> index 0000000..945c9b4
> --- /dev/null
> +++ b/tests/fs_filesystem/btrfs
> @@ -0,0 +1 @@
> +.
> \ No newline at end of file
--
paul-moore.com
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v3] selinux-testsuite: Add btrfs support for filesystem tests
2025-10-07 19:28 ` Paul Moore
@ 2025-10-07 19:47 ` Stephen Smalley
2025-10-07 19:56 ` Paul Moore
0 siblings, 1 reply; 9+ messages in thread
From: Stephen Smalley @ 2025-10-07 19:47 UTC (permalink / raw)
To: Paul Moore; +Cc: selinux, omosnace, Richard Haines
On Tue, Oct 7, 2025 at 3:29 PM Paul Moore <paul@paul-moore.com> wrote:
>
> On Tue, Oct 7, 2025 at 2:37 PM Stephen Smalley
> <stephen.smalley.work@gmail.com> wrote:
> >
> > From: Richard Haines <richard_c_haines@btinternet.com>
> >
> > This allows btrfs filesystems to be created to support the
> > filesystem mount(2) type calls and the fs_filesystem fsmount(2)
> > type calls.
> >
> > Signed-off-by: Richard Haines <richard_c_haines@btinternet.com>
> > Signed-off-by: Stephen Smalley <stephen.smalley.work@gmail.com>
> > ---
> > README.md | 2 ++
> > defconfig | 5 +++++
> > tests/Makefile | 2 +-
> > tests/filesystem/Filesystem.pm | 3 +++
> > tests/filesystem/btrfs | 1 +
> > tests/filesystem/test | 6 ++++++
> > tests/fs_filesystem/btrfs | 1 +
> > tests/fs_filesystem/test | 6 ++++++
> > 8 files changed, 25 insertions(+), 1 deletion(-)
> > create mode 120000 tests/filesystem/btrfs
> > create mode 120000 tests/fs_filesystem/btrfs
>
> ...
>
> > diff --git a/tests/filesystem/btrfs b/tests/filesystem/btrfs
> > new file mode 120000
> > index 0000000..945c9b4
> > --- /dev/null
> > +++ b/tests/filesystem/btrfs
> > @@ -0,0 +1 @@
> > +.
> > \ No newline at end of file
>
> This, and the similar file below, look odd to me. I only looked very
> quickly, but I don't see any references to these files in the rest of
> this patchset, is their inclusion in this patch a mistake, or am I
> missing something?
These are symlinks - they just look strange in a patch file.
Each tested filesystem type has a corresponding symlink in the
directory that refers to the current directory and gets used to invoke
the test script with a path that indicates the filesystem type. It's
been like that for the other filesystem types for a long time.
>
> > diff --git a/tests/fs_filesystem/btrfs b/tests/fs_filesystem/btrfs
> > new file mode 120000
> > index 0000000..945c9b4
> > --- /dev/null
> > +++ b/tests/fs_filesystem/btrfs
> > @@ -0,0 +1 @@
> > +.
> > \ No newline at end of file
>
> --
> paul-moore.com
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v3] selinux-testsuite: Add btrfs support for filesystem tests
2025-10-07 19:47 ` Stephen Smalley
@ 2025-10-07 19:56 ` Paul Moore
0 siblings, 0 replies; 9+ messages in thread
From: Paul Moore @ 2025-10-07 19:56 UTC (permalink / raw)
To: Stephen Smalley; +Cc: selinux, omosnace, Richard Haines
On Tue, Oct 7, 2025 at 3:47 PM Stephen Smalley
<stephen.smalley.work@gmail.com> wrote:
> On Tue, Oct 7, 2025 at 3:29 PM Paul Moore <paul@paul-moore.com> wrote:
> > On Tue, Oct 7, 2025 at 2:37 PM Stephen Smalley
> > <stephen.smalley.work@gmail.com> wrote:
> > >
> > > From: Richard Haines <richard_c_haines@btinternet.com>
> > >
> > > This allows btrfs filesystems to be created to support the
> > > filesystem mount(2) type calls and the fs_filesystem fsmount(2)
> > > type calls.
> > >
> > > Signed-off-by: Richard Haines <richard_c_haines@btinternet.com>
> > > Signed-off-by: Stephen Smalley <stephen.smalley.work@gmail.com>
> > > ---
> > > README.md | 2 ++
> > > defconfig | 5 +++++
> > > tests/Makefile | 2 +-
> > > tests/filesystem/Filesystem.pm | 3 +++
> > > tests/filesystem/btrfs | 1 +
> > > tests/filesystem/test | 6 ++++++
> > > tests/fs_filesystem/btrfs | 1 +
> > > tests/fs_filesystem/test | 6 ++++++
> > > 8 files changed, 25 insertions(+), 1 deletion(-)
> > > create mode 120000 tests/filesystem/btrfs
> > > create mode 120000 tests/fs_filesystem/btrfs
> >
> > ...
> >
> > > diff --git a/tests/filesystem/btrfs b/tests/filesystem/btrfs
> > > new file mode 120000
> > > index 0000000..945c9b4
> > > --- /dev/null
> > > +++ b/tests/filesystem/btrfs
> > > @@ -0,0 +1 @@
> > > +.
> > > \ No newline at end of file
> >
> > This, and the similar file below, look odd to me. I only looked very
> > quickly, but I don't see any references to these files in the rest of
> > this patchset, is their inclusion in this patch a mistake, or am I
> > missing something?
>
> These are symlinks - they just look strange in a patch file.
> Each tested filesystem type has a corresponding symlink in the
> directory that refers to the current directory and gets used to invoke
> the test script with a path that indicates the filesystem type. It's
> been like that for the other filesystem types for a long time.
Ah ha! Yes, I'm aware of the symlinks, I just never noticed one in a
diff before, or if I did I forgot :) Sorry for the noise.
--
paul-moore.com
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2025-10-07 19:59 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-07 18:35 [PATCH v3] selinux-testsuite: Add btrfs support for filesystem tests Stephen Smalley
2025-10-07 18:46 ` Stephen Smalley
2025-10-07 19:14 ` Stephen Smalley
2025-10-07 19:33 ` Paul Moore
2025-10-07 19:50 ` Stephen Smalley
2025-10-07 19:59 ` Paul Moore
2025-10-07 19:28 ` Paul Moore
2025-10-07 19:47 ` Stephen Smalley
2025-10-07 19:56 ` Paul Moore
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).