* [PATCH] btrfs: test remount with "compress" clears "compress-force"
@ 2024-10-25 11:27 fdmanana
2024-10-25 16:53 ` Zorro Lang
2024-10-25 17:24 ` [PATCH v2] " fdmanana
0 siblings, 2 replies; 6+ messages in thread
From: fdmanana @ 2024-10-25 11:27 UTC (permalink / raw)
To: fstests; +Cc: linux-btrfs, Filipe Manana
From: Filipe Manana <fdmanana@suse.com>
Test that remounting with the "compress" mount option clears the
"compress-force" mount option previously specified.
This tests a regression introduced with kernel 6.8 and recently fixed by
the following kernel commit:
3510e684b8f6 ("btrfs: clear force-compress on remount when compress mount option is given")
Signed-off-by: Filipe Manana <fdmanana@suse.com>
---
tests/btrfs/323 | 39 +++++++++++++++++++++++++++++++++++++++
tests/btrfs/323.out | 2 ++
2 files changed, 41 insertions(+)
create mode 100755 tests/btrfs/323
create mode 100644 tests/btrfs/323.out
diff --git a/tests/btrfs/323 b/tests/btrfs/323
new file mode 100755
index 00000000..fd2e2250
--- /dev/null
+++ b/tests/btrfs/323
@@ -0,0 +1,39 @@
+#! /bin/bash
+# SPDX-License-Identifier: GPL-2.0
+# Copyright (C) 2024 SUSE Linux Products GmbH. All Rights Reserved.
+#
+# Test that remounting with the "compress" mount option clears the
+# "compress-force" mount option previously specified.
+#
+. ./common/preamble
+_begin_fstest auto quick mount remount compress
+
+_require_scratch
+
+_fixed_by_kernel_commit 3510e684b8f6 \
+ "btrfs: clear force-compress on remount when compress mount option is given"
+
+_scratch_mkfs >>$seqres.full 2>&1 || _fail "mkfs failed"
+_scratch_mount -o compress-force=zlib:9
+
+# Confirm we have compress-force with zlib:9
+_mount | grep $SCRATCH_DEV | grep -q 'compress-force=zlib:9'
+if [ $? -ne 0 ]; then
+ echo "compress-force not set to zlib:9 after initial mount:"
+ _mount | grep $SCRATCH_DEV
+fi
+
+# Remount with compress=zlib:4, which should clear compress-force and set the
+# algorithm to zlib:4.
+_scratch_remount compress=zlib:4
+
+_mount | grep $SCRATCH_DEV | grep -q 'compress=zlib:4'
+if [ $? -ne 0 ]; then
+ echo "compress not set to zlib:4 after remount:"
+ _mount | grep $SCRATCH_DEV
+fi
+
+echo "Silence is golden"
+
+status=0
+exit
diff --git a/tests/btrfs/323.out b/tests/btrfs/323.out
new file mode 100644
index 00000000..5dba9b5f
--- /dev/null
+++ b/tests/btrfs/323.out
@@ -0,0 +1,2 @@
+QA output created by 323
+Silence is golden
--
2.43.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] btrfs: test remount with "compress" clears "compress-force"
2024-10-25 11:27 [PATCH] btrfs: test remount with "compress" clears "compress-force" fdmanana
@ 2024-10-25 16:53 ` Zorro Lang
2024-10-25 17:24 ` Filipe Manana
2024-10-25 17:24 ` [PATCH v2] " fdmanana
1 sibling, 1 reply; 6+ messages in thread
From: Zorro Lang @ 2024-10-25 16:53 UTC (permalink / raw)
To: fdmanana; +Cc: fstests, linux-btrfs, Filipe Manana
On Fri, Oct 25, 2024 at 12:27:01PM +0100, fdmanana@kernel.org wrote:
> From: Filipe Manana <fdmanana@suse.com>
>
> Test that remounting with the "compress" mount option clears the
> "compress-force" mount option previously specified.
>
> This tests a regression introduced with kernel 6.8 and recently fixed by
> the following kernel commit:
>
> 3510e684b8f6 ("btrfs: clear force-compress on remount when compress mount option is given")
>
> Signed-off-by: Filipe Manana <fdmanana@suse.com>
> ---
> tests/btrfs/323 | 39 +++++++++++++++++++++++++++++++++++++++
> tests/btrfs/323.out | 2 ++
> 2 files changed, 41 insertions(+)
> create mode 100755 tests/btrfs/323
> create mode 100644 tests/btrfs/323.out
>
> diff --git a/tests/btrfs/323 b/tests/btrfs/323
> new file mode 100755
> index 00000000..fd2e2250
> --- /dev/null
> +++ b/tests/btrfs/323
> @@ -0,0 +1,39 @@
> +#! /bin/bash
> +# SPDX-License-Identifier: GPL-2.0
> +# Copyright (C) 2024 SUSE Linux Products GmbH. All Rights Reserved.
> +#
> +# Test that remounting with the "compress" mount option clears the
> +# "compress-force" mount option previously specified.
> +#
> +. ./common/preamble
> +_begin_fstest auto quick mount remount compress
> +
> +_require_scratch
> +
> +_fixed_by_kernel_commit 3510e684b8f6 \
> + "btrfs: clear force-compress on remount when compress mount option is given"
> +
> +_scratch_mkfs >>$seqres.full 2>&1 || _fail "mkfs failed"
> +_scratch_mount -o compress-force=zlib:9
> +
> +# Confirm we have compress-force with zlib:9
> +_mount | grep $SCRATCH_DEV | grep -q 'compress-force=zlib:9'
How about:
grep -wq 'compress-force=zlib:9' <(findmnt -rncv -S $SCRATCH_DEV -o OPTIONS)
> +if [ $? -ne 0 ]; then
> + echo "compress-force not set to zlib:9 after initial mount:"
> + _mount | grep $SCRATCH_DEV
> +fi
> +
> +# Remount with compress=zlib:4, which should clear compress-force and set the
> +# algorithm to zlib:4.
> +_scratch_remount compress=zlib:4
> +
> +_mount | grep $SCRATCH_DEV | grep -q 'compress=zlib:4'
Same as above.
Others looks good to me.
Thanks,
Zorro
> +if [ $? -ne 0 ]; then
> + echo "compress not set to zlib:4 after remount:"
> + _mount | grep $SCRATCH_DEV
> +fi
> +
> +echo "Silence is golden"
> +
> +status=0
> +exit
> diff --git a/tests/btrfs/323.out b/tests/btrfs/323.out
> new file mode 100644
> index 00000000..5dba9b5f
> --- /dev/null
> +++ b/tests/btrfs/323.out
> @@ -0,0 +1,2 @@
> +QA output created by 323
> +Silence is golden
> --
> 2.43.0
>
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] btrfs: test remount with "compress" clears "compress-force"
2024-10-25 16:53 ` Zorro Lang
@ 2024-10-25 17:24 ` Filipe Manana
0 siblings, 0 replies; 6+ messages in thread
From: Filipe Manana @ 2024-10-25 17:24 UTC (permalink / raw)
To: Zorro Lang; +Cc: fstests, linux-btrfs, Filipe Manana
On Fri, Oct 25, 2024 at 5:53 PM Zorro Lang <zlang@redhat.com> wrote:
>
> On Fri, Oct 25, 2024 at 12:27:01PM +0100, fdmanana@kernel.org wrote:
> > From: Filipe Manana <fdmanana@suse.com>
> >
> > Test that remounting with the "compress" mount option clears the
> > "compress-force" mount option previously specified.
> >
> > This tests a regression introduced with kernel 6.8 and recently fixed by
> > the following kernel commit:
> >
> > 3510e684b8f6 ("btrfs: clear force-compress on remount when compress mount option is given")
> >
> > Signed-off-by: Filipe Manana <fdmanana@suse.com>
> > ---
> > tests/btrfs/323 | 39 +++++++++++++++++++++++++++++++++++++++
> > tests/btrfs/323.out | 2 ++
> > 2 files changed, 41 insertions(+)
> > create mode 100755 tests/btrfs/323
> > create mode 100644 tests/btrfs/323.out
> >
> > diff --git a/tests/btrfs/323 b/tests/btrfs/323
> > new file mode 100755
> > index 00000000..fd2e2250
> > --- /dev/null
> > +++ b/tests/btrfs/323
> > @@ -0,0 +1,39 @@
> > +#! /bin/bash
> > +# SPDX-License-Identifier: GPL-2.0
> > +# Copyright (C) 2024 SUSE Linux Products GmbH. All Rights Reserved.
> > +#
> > +# Test that remounting with the "compress" mount option clears the
> > +# "compress-force" mount option previously specified.
> > +#
> > +. ./common/preamble
> > +_begin_fstest auto quick mount remount compress
> > +
> > +_require_scratch
> > +
> > +_fixed_by_kernel_commit 3510e684b8f6 \
> > + "btrfs: clear force-compress on remount when compress mount option is given"
> > +
> > +_scratch_mkfs >>$seqres.full 2>&1 || _fail "mkfs failed"
> > +_scratch_mount -o compress-force=zlib:9
> > +
> > +# Confirm we have compress-force with zlib:9
> > +_mount | grep $SCRATCH_DEV | grep -q 'compress-force=zlib:9'
>
> How about:
>
> grep -wq 'compress-force=zlib:9' <(findmnt -rncv -S $SCRATCH_DEV -o OPTIONS)
Sure, works for me.
I've just sent a v2 with that change.
Thanks.
>
> > +if [ $? -ne 0 ]; then
> > + echo "compress-force not set to zlib:9 after initial mount:"
> > + _mount | grep $SCRATCH_DEV
> > +fi
> > +
> > +# Remount with compress=zlib:4, which should clear compress-force and set the
> > +# algorithm to zlib:4.
> > +_scratch_remount compress=zlib:4
> > +
> > +_mount | grep $SCRATCH_DEV | grep -q 'compress=zlib:4'
>
> Same as above.
>
> Others looks good to me.
>
> Thanks,
> Zorro
>
> > +if [ $? -ne 0 ]; then
> > + echo "compress not set to zlib:4 after remount:"
> > + _mount | grep $SCRATCH_DEV
> > +fi
> > +
> > +echo "Silence is golden"
> > +
> > +status=0
> > +exit
> > diff --git a/tests/btrfs/323.out b/tests/btrfs/323.out
> > new file mode 100644
> > index 00000000..5dba9b5f
> > --- /dev/null
> > +++ b/tests/btrfs/323.out
> > @@ -0,0 +1,2 @@
> > +QA output created by 323
> > +Silence is golden
> > --
> > 2.43.0
> >
> >
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v2] btrfs: test remount with "compress" clears "compress-force"
2024-10-25 11:27 [PATCH] btrfs: test remount with "compress" clears "compress-force" fdmanana
2024-10-25 16:53 ` Zorro Lang
@ 2024-10-25 17:24 ` fdmanana
2024-10-25 17:49 ` Zorro Lang
1 sibling, 1 reply; 6+ messages in thread
From: fdmanana @ 2024-10-25 17:24 UTC (permalink / raw)
To: fstests; +Cc: linux-btrfs, Filipe Manana
From: Filipe Manana <fdmanana@suse.com>
Test that remounting with the "compress" mount option clears the
"compress-force" mount option previously specified.
This tests a regression introduced with kernel 6.8 and recently fixed by
the following kernel commit:
3510e684b8f6 ("btrfs: clear force-compress on remount when compress mount option is given")
Signed-off-by: Filipe Manana <fdmanana@suse.com>
---
V2: Use findmnt instead of "mount | grep $SCRATCH_DEV".
tests/btrfs/323 | 39 +++++++++++++++++++++++++++++++++++++++
tests/btrfs/323.out | 2 ++
2 files changed, 41 insertions(+)
create mode 100755 tests/btrfs/323
create mode 100644 tests/btrfs/323.out
diff --git a/tests/btrfs/323 b/tests/btrfs/323
new file mode 100755
index 00000000..5cafa4b2
--- /dev/null
+++ b/tests/btrfs/323
@@ -0,0 +1,39 @@
+#! /bin/bash
+# SPDX-License-Identifier: GPL-2.0
+# Copyright (C) 2024 SUSE Linux Products GmbH. All Rights Reserved.
+#
+# Test that remounting with the "compress" mount option clears the
+# "compress-force" mount option previously specified.
+#
+. ./common/preamble
+_begin_fstest auto quick mount remount compress
+
+_require_scratch
+
+_fixed_by_kernel_commit 3510e684b8f6 \
+ "btrfs: clear force-compress on remount when compress mount option is given"
+
+_scratch_mkfs >>$seqres.full 2>&1 || _fail "mkfs failed"
+_scratch_mount -o compress-force=zlib:9
+
+# Confirm we have compress-force with zlib:9
+grep -wq 'compress-force=zlib:9' <(findmnt -rncv -S $SCRATCH_DEV -o OPTIONS)
+if [ $? -ne 0 ]; then
+ echo "compress-force not set to zlib:9 after initial mount:"
+ findmnt -rncv -S $SCRATCH_DEV -o OPTIONS
+fi
+
+# Remount with compress=zlib:4, which should clear compress-force and set the
+# algorithm to zlib:4.
+_scratch_remount compress=zlib:4
+
+grep -wq 'compress=zlib:4' <(findmnt -rncv -S $SCRATCH_DEV -o OPTIONS)
+if [ $? -ne 0 ]; then
+ echo "compress not set to zlib:4 after remount:"
+ findmnt -rncv -S $SCRATCH_DEV -o OPTIONS
+fi
+
+echo "Silence is golden"
+
+status=0
+exit
diff --git a/tests/btrfs/323.out b/tests/btrfs/323.out
new file mode 100644
index 00000000..5dba9b5f
--- /dev/null
+++ b/tests/btrfs/323.out
@@ -0,0 +1,2 @@
+QA output created by 323
+Silence is golden
--
2.43.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH v2] btrfs: test remount with "compress" clears "compress-force"
2024-10-25 17:24 ` [PATCH v2] " fdmanana
@ 2024-10-25 17:49 ` Zorro Lang
2024-10-26 2:34 ` Anand Jain
0 siblings, 1 reply; 6+ messages in thread
From: Zorro Lang @ 2024-10-25 17:49 UTC (permalink / raw)
To: fdmanana; +Cc: fstests, linux-btrfs, Filipe Manana
On Fri, Oct 25, 2024 at 06:24:21PM +0100, fdmanana@kernel.org wrote:
> From: Filipe Manana <fdmanana@suse.com>
>
> Test that remounting with the "compress" mount option clears the
> "compress-force" mount option previously specified.
>
> This tests a regression introduced with kernel 6.8 and recently fixed by
> the following kernel commit:
>
> 3510e684b8f6 ("btrfs: clear force-compress on remount when compress mount option is given")
>
> Signed-off-by: Filipe Manana <fdmanana@suse.com>
> ---
>
> V2: Use findmnt instead of "mount | grep $SCRATCH_DEV".
If there's not more review points from btrfs list, I'll merge this patch
to catch up the release of this week.
Reviewed-by: Zorro Lang <zlang@redhat.com>
Thanks,
Zorro
>
> tests/btrfs/323 | 39 +++++++++++++++++++++++++++++++++++++++
> tests/btrfs/323.out | 2 ++
> 2 files changed, 41 insertions(+)
> create mode 100755 tests/btrfs/323
> create mode 100644 tests/btrfs/323.out
>
> diff --git a/tests/btrfs/323 b/tests/btrfs/323
> new file mode 100755
> index 00000000..5cafa4b2
> --- /dev/null
> +++ b/tests/btrfs/323
> @@ -0,0 +1,39 @@
> +#! /bin/bash
> +# SPDX-License-Identifier: GPL-2.0
> +# Copyright (C) 2024 SUSE Linux Products GmbH. All Rights Reserved.
> +#
> +# Test that remounting with the "compress" mount option clears the
> +# "compress-force" mount option previously specified.
> +#
> +. ./common/preamble
> +_begin_fstest auto quick mount remount compress
> +
> +_require_scratch
> +
> +_fixed_by_kernel_commit 3510e684b8f6 \
> + "btrfs: clear force-compress on remount when compress mount option is given"
> +
> +_scratch_mkfs >>$seqres.full 2>&1 || _fail "mkfs failed"
> +_scratch_mount -o compress-force=zlib:9
> +
> +# Confirm we have compress-force with zlib:9
> +grep -wq 'compress-force=zlib:9' <(findmnt -rncv -S $SCRATCH_DEV -o OPTIONS)
> +if [ $? -ne 0 ]; then
> + echo "compress-force not set to zlib:9 after initial mount:"
> + findmnt -rncv -S $SCRATCH_DEV -o OPTIONS
> +fi
> +
> +# Remount with compress=zlib:4, which should clear compress-force and set the
> +# algorithm to zlib:4.
> +_scratch_remount compress=zlib:4
> +
> +grep -wq 'compress=zlib:4' <(findmnt -rncv -S $SCRATCH_DEV -o OPTIONS)
> +if [ $? -ne 0 ]; then
> + echo "compress not set to zlib:4 after remount:"
> + findmnt -rncv -S $SCRATCH_DEV -o OPTIONS
> +fi
> +
> +echo "Silence is golden"
> +
> +status=0
> +exit
> diff --git a/tests/btrfs/323.out b/tests/btrfs/323.out
> new file mode 100644
> index 00000000..5dba9b5f
> --- /dev/null
> +++ b/tests/btrfs/323.out
> @@ -0,0 +1,2 @@
> +QA output created by 323
> +Silence is golden
> --
> 2.43.0
>
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2] btrfs: test remount with "compress" clears "compress-force"
2024-10-25 17:49 ` Zorro Lang
@ 2024-10-26 2:34 ` Anand Jain
0 siblings, 0 replies; 6+ messages in thread
From: Anand Jain @ 2024-10-26 2:34 UTC (permalink / raw)
To: Zorro Lang, fdmanana; +Cc: fstests, linux-btrfs, Filipe Manana
LGTM
Reviewed-by: Anand Jain <anand.jain@oracle.com>
Thx, Anand
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2024-10-26 2:34 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-25 11:27 [PATCH] btrfs: test remount with "compress" clears "compress-force" fdmanana
2024-10-25 16:53 ` Zorro Lang
2024-10-25 17:24 ` Filipe Manana
2024-10-25 17:24 ` [PATCH v2] " fdmanana
2024-10-25 17:49 ` Zorro Lang
2024-10-26 2:34 ` Anand Jain
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox