From: Qu Wenruo <wqu@suse.com>
To: linux-btrfs@vger.kernel.org, fstests@vger.kernel.org
Subject: [PATCH 2/3] btrfs/192 btrfs/30[456]: explicitly specify block size to avoid false alerts
Date: Fri, 19 Sep 2025 08:13:26 +0930 [thread overview]
Message-ID: <20250918224327.12979-3-wqu@suse.com> (raw)
In-Reply-To: <20250918224327.12979-1-wqu@suse.com>
[BUG]
When running the experimental block size > page support, the test cases
btrfs/192 and btrfs/30[456] fail with the following error:
FSTYP -- btrfs
PLATFORM -- Linux/x86_64 btrfs-vm 6.17.0-rc4-custom+ #287 SMP PREEMPT_DYNAMIC Thu Sep 18 16:42:54 ACST 2025
MKFS_OPTIONS -- -s 8k /dev/mapper/test-scratch1
MOUNT_OPTIONS -- /dev/mapper/test-scratch1 /mnt/scratch
btrfs/192 436s ... [failed, exit status 1]- output mismatch (see /home/adam/xfstests/results//btrfs/192.out.bad)
--- tests/btrfs/192.out 2022-05-11 11:25:30.746666664 +0930
+++ /home/adam/xfstests/results//btrfs/192.out.bad 2025-09-18 18:34:10.511152624 +0930
@@ -1,2 +1,2 @@
QA output created by 192
-Silence is golden
+ERROR: illegal nodesize 4096 (smaller than 8192)
...
(Run 'diff -u /home/adam/xfstests/tests/btrfs/192.out /home/adam/xfstests/results//btrfs/192.out.bad' to see the entire diff)
btrfs/304 1s ... - output mismatch (see /home/adam/xfstests/results//btrfs/304.out.bad)
--- tests/btrfs/304.out 2024-07-15 16:17:42.639999997 +0930
+++ /home/adam/xfstests/results//btrfs/304.out.bad 2025-09-18 18:44:13.761000000 +0930
@@ -10,7 +10,7 @@
leaf XXXXXXXXX flags 0x1(WRITTEN) backref revision 1
fs uuid <UUID>
chunk uuid <UUID>
- item 0 key (XXXXXX RAID_STRIPE 4096) itemoff XXXXX itemsize 16
+ item 0 key (XXXXXX RAID_STRIPE 8192) itemoff XXXXX itemsize 16
stripe 0 devid 1 physical XXXXXXXXX
total bytes XXXXXXXX
...
(Run 'diff -u /home/adam/xfstests/tests/btrfs/304.out /home/adam/xfstests/results//btrfs/304.out.bad' to see the entire diff)
btrfs/305 1s ... - output mismatch (see /home/adam/xfstests/results//btrfs/305.out.bad)
--- tests/btrfs/305.out 2024-07-15 16:17:42.639999997 +0930
+++ /home/adam/xfstests/results//btrfs/305.out.bad 2025-09-18 18:44:14.914196231 +0930
@@ -12,11 +12,9 @@
leaf XXXXXXXXX flags 0x1(WRITTEN) backref revision 1
fs uuid <UUID>
chunk uuid <UUID>
- item 0 key (XXXXXX RAID_STRIPE 61440) itemoff XXXXX itemsize 16
+ item 0 key (XXXXXX RAID_STRIPE 65536) itemoff XXXXX itemsize 16
stripe 0 devid 1 physical XXXXXXXXX
- item 1 key (XXXXXX RAID_STRIPE 4096) itemoff XXXXX itemsize 16
...
(Run 'diff -u /home/adam/xfstests/tests/btrfs/305.out /home/adam/xfstests/results//btrfs/305.out.bad' to see the entire diff)
btrfs/306 1s ... - output mismatch (see /home/adam/xfstests/results//btrfs/306.out.bad)
--- tests/btrfs/306.out 2024-07-15 16:17:42.639999997 +0930
+++ /home/adam/xfstests/results//btrfs/306.out.bad 2025-09-18 18:44:16.075000000 +0930
@@ -14,7 +14,7 @@
chunk uuid <UUID>
item 0 key (XXXXXX RAID_STRIPE 65536) itemoff XXXXX itemsize 16
stripe 0 devid 1 physical XXXXXXXXX
- item 1 key (XXXXXX RAID_STRIPE 4096) itemoff XXXXX itemsize 16
+ item 1 key (XXXXXX RAID_STRIPE 8192) itemoff XXXXX itemsize 16
stripe 0 devid 2 physical XXXXXXXXX
total bytes XXXXXXXX
...
(Run 'diff -u /home/adam/xfstests/tests/btrfs/306.out /home/adam/xfstests/results//btrfs/306.out.bad' to see the entire diff)
Please note that, btrfs bs > ps is still under development.
This is only an early run to expose false alerts.
[CAUSE]
The test case btrfs/192 requires 4K nodesize to bump up tree size, and
btrfs/30[456] all requires 4K block size as the workload is designed
with that.
However if the QA runner is specify other block size (8K in this case),
it will break the 4K block size assumption of those tests, either
results mkfs failure in btrfs/192, or output difference for
btrfs/30[456].
[FIX]
Just explicitly specify the 4K block size during mkfs.
And since we're here, remove the out-of-date page size check, as btrfs
has subpage block size support for a while.
Instead use a more accurate supported sector size check, this allows the
test to be run on aarch64 with 64K page size.
Signed-off-by: Qu Wenruo <wqu@suse.com>
---
tests/btrfs/192 | 8 ++------
tests/btrfs/304 | 5 ++---
tests/btrfs/305 | 5 ++---
tests/btrfs/306 | 5 ++---
4 files changed, 8 insertions(+), 15 deletions(-)
diff --git a/tests/btrfs/192 b/tests/btrfs/192
index 0a8ab2c1..56ec2b28 100755
--- a/tests/btrfs/192
+++ b/tests/btrfs/192
@@ -33,11 +33,7 @@ _require_btrfs_mkfs_feature "no-holes"
_require_log_writes
_require_scratch
_require_attrs
-
-# We require a 4K nodesize to ensure the test isn't too slow
-if [ $(_get_page_size) -ne 4096 ]; then
- _notrun "This test doesn't support non-4K page size yet"
-fi
+_require_btrfs_support_sectorsize 4096
runtime=30
nr_cpus=$("$here/src/feature" -o)
@@ -55,7 +51,7 @@ $BLKDISCARD_PROG $LOGWRITES_DMDEV > /dev/null 2>&1
# Use no-holes to avoid warnings of missing file extent items (expected
# for holes due to mix of buffered and direct IO writes).
# And use 4K nodesize to bump tree height.
-_log_writes_mkfs -O no-holes -n 4k >> $seqres.full
+_log_writes_mkfs -O no-holes -n 4k -s 4k >> $seqres.full
_log_writes_mount
$BTRFS_UTIL_PROG subvolume create $SCRATCH_MNT/src > /dev/null
diff --git a/tests/btrfs/304 b/tests/btrfs/304
index b7ed66af..18f73590 100755
--- a/tests/btrfs/304
+++ b/tests/btrfs/304
@@ -20,8 +20,7 @@ _require_btrfs_fs_feature "raid_stripe_tree"
_require_btrfs_fs_feature "free_space_tree"
_require_btrfs_free_space_tree
_require_btrfs_no_compress
-
-test $(_get_page_size) -eq 4096 || _notrun "this tests requires 4k pagesize"
+_require_btrfs_support_sectorsize 4096
test_4k_write()
{
@@ -31,7 +30,7 @@ test_4k_write()
_scratch_dev_pool_get $ndevs
echo "==== Testing $profile ===="
- _scratch_pool_mkfs -d $profile -m $profile -O raid-stripe-tree
+ _scratch_pool_mkfs -s 4k -d $profile -m $profile -O raid-stripe-tree
_scratch_mount
$XFS_IO_PROG -fc "pwrite 0 4k" "$SCRATCH_MNT/foo" | _filter_xfs_io
diff --git a/tests/btrfs/305 b/tests/btrfs/305
index ad060853..45747627 100755
--- a/tests/btrfs/305
+++ b/tests/btrfs/305
@@ -21,8 +21,7 @@ _require_btrfs_fs_feature "raid_stripe_tree"
_require_btrfs_fs_feature "free_space_tree"
_require_btrfs_free_space_tree
_require_btrfs_no_compress
-
-test $(_get_page_size) -eq 4096 || _notrun "this tests requires 4k pagesize"
+_require_btrfs_support_sectorsize 4096
test_8k_new_stripe()
{
@@ -32,7 +31,7 @@ test_8k_new_stripe()
_scratch_dev_pool_get $ndevs
echo "==== Testing $profile ===="
- _scratch_pool_mkfs -d $profile -m $profile -O raid-stripe-tree
+ _scratch_pool_mkfs -s 4k -d $profile -m $profile -O raid-stripe-tree
_scratch_mount
# Fill the first stripe up to 64k - 4k
diff --git a/tests/btrfs/306 b/tests/btrfs/306
index b47c446b..db3defc8 100755
--- a/tests/btrfs/306
+++ b/tests/btrfs/306
@@ -21,8 +21,7 @@ _require_btrfs_fs_feature "raid_stripe_tree"
_require_btrfs_fs_feature "free_space_tree"
_require_btrfs_free_space_tree
_require_btrfs_no_compress
-
-test $(_get_page_size) -eq 4096 || _notrun "this tests requires 4k pagesize"
+_require_btrfs_support_sectorsize 4096
test_4k_write_64koff()
{
@@ -32,7 +31,7 @@ test_4k_write_64koff()
_scratch_dev_pool_get $ndevs
echo "==== Testing $profile ===="
- _scratch_pool_mkfs -d $profile -m $profile -O raid-stripe-tree
+ _scratch_pool_mkfs -s 4k -d $profile -m $profile -O raid-stripe-tree
_scratch_mount
# precondition one stripe
--
2.51.0
next prev parent reply other threads:[~2025-09-18 22:43 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-18 22:43 [PATCH 0/3] btrfs: fix false alerts when running with 8K block size and 4K page size Qu Wenruo
2025-09-18 22:43 ` [PATCH 1/3] btrfs/012 btrfs/136: skip the test if ext* doesn't support the block size Qu Wenruo
2025-09-28 14:54 ` Zorro Lang
2025-09-28 20:42 ` Qu Wenruo
2025-10-01 20:50 ` Zorro Lang
2025-10-01 21:11 ` Qu Wenruo
2025-09-18 22:43 ` Qu Wenruo [this message]
2025-09-28 14:12 ` [PATCH 2/3] btrfs/192 btrfs/30[456]: explicitly specify block size to avoid false alerts Zorro Lang
2025-09-18 22:43 ` [PATCH 3/3] btrfs/26[67]: update the stale comments Qu Wenruo
2025-09-28 14:09 ` Zorro Lang
-- strict thread matches above, loose matches on Subject: below --
2025-09-18 22:33 [PATCH 0/3] btrfs: fix false alerts when running with 8K block size and 4K page size Qu Wenruo
2025-09-18 22:33 ` [PATCH 2/3] btrfs/192 btrfs/30[456]: explicitly specify block size to avoid false alerts Qu Wenruo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250918224327.12979-3-wqu@suse.com \
--to=wqu@suse.com \
--cc=fstests@vger.kernel.org \
--cc=linux-btrfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).