linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/3] btrfs/192 btrfs/30[456]: explicitly specify block size to avoid false alerts
  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 ` Qu Wenruo
  0 siblings, 0 replies; 11+ messages in thread
From: Qu Wenruo @ 2025-09-18 22:33 UTC (permalink / raw)
  To: linux-btrfs, fstests

[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


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

* [PATCH 0/3] btrfs: fix false alerts when running with 8K block size and 4K page size
@ 2025-09-18 22:43 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
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Qu Wenruo @ 2025-09-18 22:43 UTC (permalink / raw)
  To: linux-btrfs, fstests

I am developing the bs > ps support for btrfs, and now it can pass most
btrfs and generic runs.

Some failures are due to the limitaions of the current bs > ps,
including:

- btrfs/023
  No RAID56 support, and the test case doesn't respect
  BTRFS_PROFILE_CONFIGS

- btrfs/131
  No v1 cache support just like subpage bs support.
  No big deal, as v1 cache is already marked deprecated.
  When the full deprecation comes, the test case needs some update.

- btrfs/226
  No Direct IO support.

- btrfs/267
  No Direct IO support thus the read falls back to buffered one.
  The fallback may change the pid thus some mirror is not properly read
  from disk and no read repair.

- btrfs/281
  No encoded send support

However there are some btrfs failures that are false alerts:

- btrfs/012
- btrfs/136
  Those are btrfs-convert tests, however ext* doesn't support bs > ps
  cases yet.

  Fix them by skip the run if the initial ext* mount failed.

- btrfs/192
  This one requires 4K nodesize, which implies 4K block size, and
  conflicts with user specified non-4K block size.

- btrfs/30[456]
  Those test cases have strict 4K block size requirement but still
  follows the user specified block size during mkfs.

  Fix btrfs/192 and btrfs/30[456] by explicitly specify 4K block size
  during mkfs.

There is also a minor comment mismatch in btrfs/267:

- btrfs/267 is verifying direct read repair but comments says buffered
  Instead it's btrfs/266 verifying the buffered behavior.
  So it's purely a comment mismatch.

  Fix it by explicitly mentioning buffered/direct IO for btrfs/26[67].


Qu Wenruo (3):
  btrfs/012 btrfs/136: skip the test if ext* doesn't support the block
    size
  btrfs/192 btrfs/30[456]: explicitly specify block size to avoid false
    alerts
  btrfs/26[67]: update the stale comments

 tests/btrfs/012 | 3 +++
 tests/btrfs/136 | 3 +++
 tests/btrfs/192 | 8 ++------
 tests/btrfs/266 | 4 ++--
 tests/btrfs/267 | 2 +-
 tests/btrfs/304 | 5 ++---
 tests/btrfs/305 | 5 ++---
 tests/btrfs/306 | 5 ++---
 8 files changed, 17 insertions(+), 18 deletions(-)

-- 
2.51.0


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

* [PATCH 1/3] btrfs/012 btrfs/136: skip the test if ext* doesn't support the block size
  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 ` Qu Wenruo
  2025-09-28 14:54   ` Zorro Lang
  2025-09-18 22:43 ` [PATCH 2/3] btrfs/192 btrfs/30[456]: explicitly specify block size to avoid false alerts Qu Wenruo
  2025-09-18 22:43 ` [PATCH 3/3] btrfs/26[67]: update the stale comments Qu Wenruo
  2 siblings, 1 reply; 11+ messages in thread
From: Qu Wenruo @ 2025-09-18 22:43 UTC (permalink / raw)
  To: linux-btrfs, fstests

[FALSE ALERT]
When testing btrfs bs > ps support, the test cases btrfs/012 and
btrfs/136 fail like the following:

 FSTYP         -- btrfs
 PLATFORM      -- Linux/x86_64 btrfs-vm 6.17.0-rc4-custom+ #285 SMP PREEMPT_DYNAMIC Mon Sep 15 14:40:01 ACST 2025
 MKFS_OPTIONS  -- -s 8k /dev/mapper/test-scratch1
 MOUNT_OPTIONS -- /dev/mapper/test-scratch1 /mnt/scratch

 btrfs/012       [failed, exit status 1]- output mismatch (see /home/adam/xfstests/results//btrfs/012.out.bad)
     --- tests/btrfs/012.out	2024-07-17 16:27:18.790000343 +0930
     +++ /home/adam/xfstests/results//btrfs/012.out.bad	2025-09-15 16:32:55.185922173 +0930
     @@ -1,7 +1,11 @@
      QA output created by 012
     +mount: /mnt/scratch: wrong fs type, bad option, bad superblock on /dev/mapper/test-scratch1, missing codepage or helper program, or other error.
     +       dmesg(1) may have more information after failed mount system call.
     +mkdir: cannot create directory '/mnt/scratch/stressdir': File exists
     +umount: /mnt/scratch: not mounted.
      Checking converted btrfs against the original one:
     -OK
     ...
     (Run 'diff -u /home/adam/xfstests/tests/btrfs/012.out /home/adam/xfstests/results//btrfs/012.out.bad'  to see the entire diff)

 btrfs/136 3s ... - output mismatch (see /home/adam/xfstests/results//btrfs/136.out.bad)
     --- tests/btrfs/136.out	2022-05-11 11:25:30.743333331 +0930
     +++ /home/adam/xfstests/results//btrfs/136.out.bad	2025-09-19 07:00:00.395280850 +0930
     @@ -1,2 +1,10 @@
      QA output created by 136
     +mount: /mnt/scratch: wrong fs type, bad option, bad superblock on /dev/mapper/test-scratch1, missing codepage or helper program, or other error.
     +       dmesg(1) may have more information after failed mount system call.
     +umount: /mnt/scratch: not mounted.
     +mount: /mnt/scratch: wrong fs type, bad option, bad superblock on /dev/mapper/test-scratch1, missing codepage or helper program, or other error.
     +       dmesg(1) may have more information after failed mount system call.
     +umount: /mnt/scratch: not mounted.
     ...
     (Run 'diff -u /home/adam/xfstests/tests/btrfs/136.out /home/adam/xfstests/results//btrfs/136.out.bad'  to see the entire diff)

[CAUSE]
Currently ext* doesn't support block size larger than page size, thus
at mkfs time it will output the following warning:

 Warning: blocksize 8192 not usable on most systems.
 mke2fs 1.47.3 (8-Jul-2025)
 Warning: 8192-byte blocks too big for system (max 4096), forced to continue

Furthermore at ext* mount time it will fail with the following dmesg:

 EXT4-fs (loop0): bad block size 8192

[FIX]
Check if the mount of the newly created ext* succeeded.

If not, since the only extra parameter for mkfs is the block size, we
know it's some block size ext* not yet supported, and skip the test
case.

Signed-off-by: Qu Wenruo <wqu@suse.com>
---
 tests/btrfs/012 | 3 +++
 tests/btrfs/136 | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/tests/btrfs/012 b/tests/btrfs/012
index f41d7e4e..665831b9 100755
--- a/tests/btrfs/012
+++ b/tests/btrfs/012
@@ -42,6 +42,9 @@ $MKFS_EXT4_PROG -F -b $BLOCK_SIZE $SCRATCH_DEV > $seqres.full 2>&1 || \
 	_notrun "Could not create ext4 filesystem"
 # Manual mount so we don't use -t btrfs or selinux context
 mount -t ext4 $SCRATCH_DEV $SCRATCH_MNT
+if [ $? -ne 0 ]; then
+	_notrun "block size $BLOCK_SIZE is not supported by ext4"
+fi
 
 echo "populating the initial ext fs:" >> $seqres.full
 mkdir "$SCRATCH_MNT/$BASENAME"
diff --git a/tests/btrfs/136 b/tests/btrfs/136
index 65bbcf51..6b4b52e4 100755
--- a/tests/btrfs/136
+++ b/tests/btrfs/136
@@ -45,6 +45,9 @@ $MKFS_EXT4_PROG -F -t ext3 -b $BLOCK_SIZE $SCRATCH_DEV > $seqres.full 2>&1 || \
 
 # mount and populate non-extent file
 mount -t ext3 $SCRATCH_DEV $SCRATCH_MNT
+if [ $? -ne 0 ]; then
+	_notrun "block size $BLOCK_SIZE is not supported by ext3"
+fi
 populate_data "$SCRATCH_MNT/ext3_ext4_data/ext3"
 _scratch_unmount
 
-- 
2.51.0


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

* [PATCH 2/3] btrfs/192 btrfs/30[456]: explicitly specify block size to avoid false alerts
  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-18 22:43 ` Qu Wenruo
  2025-09-28 14:12   ` Zorro Lang
  2025-09-18 22:43 ` [PATCH 3/3] btrfs/26[67]: update the stale comments Qu Wenruo
  2 siblings, 1 reply; 11+ messages in thread
From: Qu Wenruo @ 2025-09-18 22:43 UTC (permalink / raw)
  To: linux-btrfs, fstests

[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


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

* [PATCH 3/3] btrfs/26[67]: update the stale comments
  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-18 22:43 ` [PATCH 2/3] btrfs/192 btrfs/30[456]: explicitly specify block size to avoid false alerts Qu Wenruo
@ 2025-09-18 22:43 ` Qu Wenruo
  2025-09-28 14:09   ` Zorro Lang
  2 siblings, 1 reply; 11+ messages in thread
From: Qu Wenruo @ 2025-09-18 22:43 UTC (permalink / raw)
  To: linux-btrfs, fstests

Test case btrfs/266 is verifying the buffered read repair on RAID1C3,
and btrfs/267 is verifying the direct IO read repair on RAID1C3.

However btrfs/267 is using incorrect comments, it says the test case is
verify buffered read repair, but it's not the case.

Fix those stale comments by explicitly mention buffered/direct IO for
each test case. (btrfs/266 for buffered, btrfs/267 for direct)

Signed-off-by: Qu Wenruo <wqu@suse.com>
---
 tests/btrfs/266 | 4 ++--
 tests/btrfs/267 | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/tests/btrfs/266 b/tests/btrfs/266
index 3490ecce..f8407c98 100755
--- a/tests/btrfs/266
+++ b/tests/btrfs/266
@@ -5,8 +5,8 @@
 #
 # FS QA Test 266
 #
-# Test that btrfs raid repair on a raid1c3 profile can repair interleaving
-# errors on all mirrors.
+# Test that btrfs buffered read repair on a raid1c3 profile can repair
+# interleaving errors on all mirrors.
 #
 
 . ./common/preamble
diff --git a/tests/btrfs/267 b/tests/btrfs/267
index 66e08d18..22c4aeaa 100755
--- a/tests/btrfs/267
+++ b/tests/btrfs/267
@@ -5,7 +5,7 @@
 #
 # FS QA Test 267
 #
-# Test that btrfs buffered read repair on a raid1c3 profile can repair
+# Test that btrfs direct IO read repair on a raid1c3 profile can repair
 # interleaving errors on all mirrors.
 #
 
-- 
2.51.0


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

* Re: [PATCH 3/3] btrfs/26[67]: update the stale comments
  2025-09-18 22:43 ` [PATCH 3/3] btrfs/26[67]: update the stale comments Qu Wenruo
@ 2025-09-28 14:09   ` Zorro Lang
  0 siblings, 0 replies; 11+ messages in thread
From: Zorro Lang @ 2025-09-28 14:09 UTC (permalink / raw)
  To: Qu Wenruo; +Cc: linux-btrfs, fstests

On Fri, Sep 19, 2025 at 08:13:27AM +0930, Qu Wenruo wrote:
> Test case btrfs/266 is verifying the buffered read repair on RAID1C3,
> and btrfs/267 is verifying the direct IO read repair on RAID1C3.
> 
> However btrfs/267 is using incorrect comments, it says the test case is
> verify buffered read repair, but it's not the case.
> 
> Fix those stale comments by explicitly mention buffered/direct IO for
> each test case. (btrfs/266 for buffered, btrfs/267 for direct)
> 
> Signed-off-by: Qu Wenruo <wqu@suse.com>
> ---

Makes sense to me,

Reviewed-by: Zorro Lang <zlang@redhat.com>

>  tests/btrfs/266 | 4 ++--
>  tests/btrfs/267 | 2 +-
>  2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/tests/btrfs/266 b/tests/btrfs/266
> index 3490ecce..f8407c98 100755
> --- a/tests/btrfs/266
> +++ b/tests/btrfs/266
> @@ -5,8 +5,8 @@
>  #
>  # FS QA Test 266
>  #
> -# Test that btrfs raid repair on a raid1c3 profile can repair interleaving
> -# errors on all mirrors.
> +# Test that btrfs buffered read repair on a raid1c3 profile can repair
> +# interleaving errors on all mirrors.
>  #
>  
>  . ./common/preamble
> diff --git a/tests/btrfs/267 b/tests/btrfs/267
> index 66e08d18..22c4aeaa 100755
> --- a/tests/btrfs/267
> +++ b/tests/btrfs/267
> @@ -5,7 +5,7 @@
>  #
>  # FS QA Test 267
>  #
> -# Test that btrfs buffered read repair on a raid1c3 profile can repair
> +# Test that btrfs direct IO read repair on a raid1c3 profile can repair
>  # interleaving errors on all mirrors.
>  #
>  
> -- 
> 2.51.0
> 
> 


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

* Re: [PATCH 2/3] btrfs/192 btrfs/30[456]: explicitly specify block size to avoid false alerts
  2025-09-18 22:43 ` [PATCH 2/3] btrfs/192 btrfs/30[456]: explicitly specify block size to avoid false alerts Qu Wenruo
@ 2025-09-28 14:12   ` Zorro Lang
  0 siblings, 0 replies; 11+ messages in thread
From: Zorro Lang @ 2025-09-28 14:12 UTC (permalink / raw)
  To: Qu Wenruo; +Cc: linux-btrfs, fstests

On Fri, Sep 19, 2025 at 08:13:26AM +0930, Qu Wenruo wrote:
> [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>
> ---

Makes sense to me, welcome more review points from btrfs list.

Reviewed-by: Zorro Lang <zlang@redhat.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
> 
> 


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

* Re: [PATCH 1/3] btrfs/012 btrfs/136: skip the test if ext* doesn't support the block size
  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
  0 siblings, 1 reply; 11+ messages in thread
From: Zorro Lang @ 2025-09-28 14:54 UTC (permalink / raw)
  To: Qu Wenruo; +Cc: linux-btrfs, fstests

On Fri, Sep 19, 2025 at 08:13:25AM +0930, Qu Wenruo wrote:
> [FALSE ALERT]
> When testing btrfs bs > ps support, the test cases btrfs/012 and
> btrfs/136 fail like the following:
> 
>  FSTYP         -- btrfs
>  PLATFORM      -- Linux/x86_64 btrfs-vm 6.17.0-rc4-custom+ #285 SMP PREEMPT_DYNAMIC Mon Sep 15 14:40:01 ACST 2025
>  MKFS_OPTIONS  -- -s 8k /dev/mapper/test-scratch1
>  MOUNT_OPTIONS -- /dev/mapper/test-scratch1 /mnt/scratch
> 
>  btrfs/012       [failed, exit status 1]- output mismatch (see /home/adam/xfstests/results//btrfs/012.out.bad)
>      --- tests/btrfs/012.out	2024-07-17 16:27:18.790000343 +0930
>      +++ /home/adam/xfstests/results//btrfs/012.out.bad	2025-09-15 16:32:55.185922173 +0930
>      @@ -1,7 +1,11 @@
>       QA output created by 012
>      +mount: /mnt/scratch: wrong fs type, bad option, bad superblock on /dev/mapper/test-scratch1, missing codepage or helper program, or other error.
>      +       dmesg(1) may have more information after failed mount system call.
>      +mkdir: cannot create directory '/mnt/scratch/stressdir': File exists
>      +umount: /mnt/scratch: not mounted.
>       Checking converted btrfs against the original one:
>      -OK
>      ...
>      (Run 'diff -u /home/adam/xfstests/tests/btrfs/012.out /home/adam/xfstests/results//btrfs/012.out.bad'  to see the entire diff)
> 
>  btrfs/136 3s ... - output mismatch (see /home/adam/xfstests/results//btrfs/136.out.bad)
>      --- tests/btrfs/136.out	2022-05-11 11:25:30.743333331 +0930
>      +++ /home/adam/xfstests/results//btrfs/136.out.bad	2025-09-19 07:00:00.395280850 +0930
>      @@ -1,2 +1,10 @@
>       QA output created by 136
>      +mount: /mnt/scratch: wrong fs type, bad option, bad superblock on /dev/mapper/test-scratch1, missing codepage or helper program, or other error.
>      +       dmesg(1) may have more information after failed mount system call.
>      +umount: /mnt/scratch: not mounted.
>      +mount: /mnt/scratch: wrong fs type, bad option, bad superblock on /dev/mapper/test-scratch1, missing codepage or helper program, or other error.
>      +       dmesg(1) may have more information after failed mount system call.
>      +umount: /mnt/scratch: not mounted.
>      ...
>      (Run 'diff -u /home/adam/xfstests/tests/btrfs/136.out /home/adam/xfstests/results//btrfs/136.out.bad'  to see the entire diff)
> 
> [CAUSE]
> Currently ext* doesn't support block size larger than page size, thus
> at mkfs time it will output the following warning:
> 
>  Warning: blocksize 8192 not usable on most systems.
>  mke2fs 1.47.3 (8-Jul-2025)
>  Warning: 8192-byte blocks too big for system (max 4096), forced to continue
> 
> Furthermore at ext* mount time it will fail with the following dmesg:
> 
>  EXT4-fs (loop0): bad block size 8192
> 
> [FIX]
> Check if the mount of the newly created ext* succeeded.
> 
> If not, since the only extra parameter for mkfs is the block size, we
> know it's some block size ext* not yet supported, and skip the test
> case.
> 
> Signed-off-by: Qu Wenruo <wqu@suse.com>
> ---
>  tests/btrfs/012 | 3 +++
>  tests/btrfs/136 | 3 +++
>  2 files changed, 6 insertions(+)
> 
> diff --git a/tests/btrfs/012 b/tests/btrfs/012
> index f41d7e4e..665831b9 100755
> --- a/tests/btrfs/012
> +++ b/tests/btrfs/012
> @@ -42,6 +42,9 @@ $MKFS_EXT4_PROG -F -b $BLOCK_SIZE $SCRATCH_DEV > $seqres.full 2>&1 || \
>  	_notrun "Could not create ext4 filesystem"
>  # Manual mount so we don't use -t btrfs or selinux context
>  mount -t ext4 $SCRATCH_DEV $SCRATCH_MNT
> +if [ $? -ne 0 ]; then
> +	_notrun "block size $BLOCK_SIZE is not supported by ext4"
> +fi

Hmm... the mount failure maybe not caused by the "$BLOCK_SIZE is not supported",
I'm wondering if this _notrun might ignore real bug. How about check the
"blocksize < pagesize" at least?

>  
>  echo "populating the initial ext fs:" >> $seqres.full
>  mkdir "$SCRATCH_MNT/$BASENAME"
> diff --git a/tests/btrfs/136 b/tests/btrfs/136
> index 65bbcf51..6b4b52e4 100755
> --- a/tests/btrfs/136
> +++ b/tests/btrfs/136
> @@ -45,6 +45,9 @@ $MKFS_EXT4_PROG -F -t ext3 -b $BLOCK_SIZE $SCRATCH_DEV > $seqres.full 2>&1 || \
>  
>  # mount and populate non-extent file
>  mount -t ext3 $SCRATCH_DEV $SCRATCH_MNT
> +if [ $? -ne 0 ]; then
> +	_notrun "block size $BLOCK_SIZE is not supported by ext3"
> +fi
>  populate_data "$SCRATCH_MNT/ext3_ext4_data/ext3"
>  _scratch_unmount
>  
> -- 
> 2.51.0
> 
> 


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

* Re: [PATCH 1/3] btrfs/012 btrfs/136: skip the test if ext* doesn't support the block size
  2025-09-28 14:54   ` Zorro Lang
@ 2025-09-28 20:42     ` Qu Wenruo
  2025-10-01 20:50       ` Zorro Lang
  0 siblings, 1 reply; 11+ messages in thread
From: Qu Wenruo @ 2025-09-28 20:42 UTC (permalink / raw)
  To: Zorro Lang, Qu Wenruo; +Cc: linux-btrfs, fstests



在 2025/9/29 00:24, Zorro Lang 写道:
> On Fri, Sep 19, 2025 at 08:13:25AM +0930, Qu Wenruo wrote:
>> [FALSE ALERT]
>> When testing btrfs bs > ps support, the test cases btrfs/012 and
>> btrfs/136 fail like the following:
>>
>>   FSTYP         -- btrfs
>>   PLATFORM      -- Linux/x86_64 btrfs-vm 6.17.0-rc4-custom+ #285 SMP PREEMPT_DYNAMIC Mon Sep 15 14:40:01 ACST 2025
>>   MKFS_OPTIONS  -- -s 8k /dev/mapper/test-scratch1
>>   MOUNT_OPTIONS -- /dev/mapper/test-scratch1 /mnt/scratch
>>
>>   btrfs/012       [failed, exit status 1]- output mismatch (see /home/adam/xfstests/results//btrfs/012.out.bad)
>>       --- tests/btrfs/012.out	2024-07-17 16:27:18.790000343 +0930
>>       +++ /home/adam/xfstests/results//btrfs/012.out.bad	2025-09-15 16:32:55.185922173 +0930
>>       @@ -1,7 +1,11 @@
>>        QA output created by 012
>>       +mount: /mnt/scratch: wrong fs type, bad option, bad superblock on /dev/mapper/test-scratch1, missing codepage or helper program, or other error.
>>       +       dmesg(1) may have more information after failed mount system call.
>>       +mkdir: cannot create directory '/mnt/scratch/stressdir': File exists
>>       +umount: /mnt/scratch: not mounted.
>>        Checking converted btrfs against the original one:
>>       -OK
>>       ...
>>       (Run 'diff -u /home/adam/xfstests/tests/btrfs/012.out /home/adam/xfstests/results//btrfs/012.out.bad'  to see the entire diff)
>>
>>   btrfs/136 3s ... - output mismatch (see /home/adam/xfstests/results//btrfs/136.out.bad)
>>       --- tests/btrfs/136.out	2022-05-11 11:25:30.743333331 +0930
>>       +++ /home/adam/xfstests/results//btrfs/136.out.bad	2025-09-19 07:00:00.395280850 +0930
>>       @@ -1,2 +1,10 @@
>>        QA output created by 136
>>       +mount: /mnt/scratch: wrong fs type, bad option, bad superblock on /dev/mapper/test-scratch1, missing codepage or helper program, or other error.
>>       +       dmesg(1) may have more information after failed mount system call.
>>       +umount: /mnt/scratch: not mounted.
>>       +mount: /mnt/scratch: wrong fs type, bad option, bad superblock on /dev/mapper/test-scratch1, missing codepage or helper program, or other error.
>>       +       dmesg(1) may have more information after failed mount system call.
>>       +umount: /mnt/scratch: not mounted.
>>       ...
>>       (Run 'diff -u /home/adam/xfstests/tests/btrfs/136.out /home/adam/xfstests/results//btrfs/136.out.bad'  to see the entire diff)
>>
>> [CAUSE]
>> Currently ext* doesn't support block size larger than page size, thus
>> at mkfs time it will output the following warning:
>>
>>   Warning: blocksize 8192 not usable on most systems.
>>   mke2fs 1.47.3 (8-Jul-2025)
>>   Warning: 8192-byte blocks too big for system (max 4096), forced to continue
>>
>> Furthermore at ext* mount time it will fail with the following dmesg:
>>
>>   EXT4-fs (loop0): bad block size 8192
>>
>> [FIX]
>> Check if the mount of the newly created ext* succeeded.
>>
>> If not, since the only extra parameter for mkfs is the block size, we
>> know it's some block size ext* not yet supported, and skip the test
>> case.
>>
>> Signed-off-by: Qu Wenruo <wqu@suse.com>
>> ---
>>   tests/btrfs/012 | 3 +++
>>   tests/btrfs/136 | 3 +++
>>   2 files changed, 6 insertions(+)
>>
>> diff --git a/tests/btrfs/012 b/tests/btrfs/012
>> index f41d7e4e..665831b9 100755
>> --- a/tests/btrfs/012
>> +++ b/tests/btrfs/012
>> @@ -42,6 +42,9 @@ $MKFS_EXT4_PROG -F -b $BLOCK_SIZE $SCRATCH_DEV > $seqres.full 2>&1 || \
>>   	_notrun "Could not create ext4 filesystem"
>>   # Manual mount so we don't use -t btrfs or selinux context
>>   mount -t ext4 $SCRATCH_DEV $SCRATCH_MNT
>> +if [ $? -ne 0 ]; then
>> +	_notrun "block size $BLOCK_SIZE is not supported by ext4"
>> +fi
> 
> Hmm... the mount failure maybe not caused by the "$BLOCK_SIZE is not supported",
> I'm wondering if this _notrun might ignore real bug. How about check the
> "blocksize < pagesize" at least?

The only extra parameter passed to mkfs.ext* is "-b $BLOCKSIZE", and if 
it's really some bug inside e2fsprog and it only affects bs > ps, we're 
still going to miss the bug.

Is there any proper way to reliably check the supported block size of 
ext*? Like some sysfs knobs?

Thanks,
Qu

> 
>>   
>>   echo "populating the initial ext fs:" >> $seqres.full
>>   mkdir "$SCRATCH_MNT/$BASENAME"
>> diff --git a/tests/btrfs/136 b/tests/btrfs/136
>> index 65bbcf51..6b4b52e4 100755
>> --- a/tests/btrfs/136
>> +++ b/tests/btrfs/136
>> @@ -45,6 +45,9 @@ $MKFS_EXT4_PROG -F -t ext3 -b $BLOCK_SIZE $SCRATCH_DEV > $seqres.full 2>&1 || \
>>   
>>   # mount and populate non-extent file
>>   mount -t ext3 $SCRATCH_DEV $SCRATCH_MNT
>> +if [ $? -ne 0 ]; then
>> +	_notrun "block size $BLOCK_SIZE is not supported by ext3"
>> +fi
>>   populate_data "$SCRATCH_MNT/ext3_ext4_data/ext3"
>>   _scratch_unmount
>>   
>> -- 
>> 2.51.0
>>
>>
> 
> 


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

* Re: [PATCH 1/3] btrfs/012 btrfs/136: skip the test if ext* doesn't support the block size
  2025-09-28 20:42     ` Qu Wenruo
@ 2025-10-01 20:50       ` Zorro Lang
  2025-10-01 21:11         ` Qu Wenruo
  0 siblings, 1 reply; 11+ messages in thread
From: Zorro Lang @ 2025-10-01 20:50 UTC (permalink / raw)
  To: Qu Wenruo; +Cc: Qu Wenruo, linux-btrfs, fstests

On Mon, Sep 29, 2025 at 06:12:17AM +0930, Qu Wenruo wrote:
> 
> 
> 在 2025/9/29 00:24, Zorro Lang 写道:
> > On Fri, Sep 19, 2025 at 08:13:25AM +0930, Qu Wenruo wrote:
> > > [FALSE ALERT]
> > > When testing btrfs bs > ps support, the test cases btrfs/012 and
> > > btrfs/136 fail like the following:
> > > 
> > >   FSTYP         -- btrfs
> > >   PLATFORM      -- Linux/x86_64 btrfs-vm 6.17.0-rc4-custom+ #285 SMP PREEMPT_DYNAMIC Mon Sep 15 14:40:01 ACST 2025
> > >   MKFS_OPTIONS  -- -s 8k /dev/mapper/test-scratch1
> > >   MOUNT_OPTIONS -- /dev/mapper/test-scratch1 /mnt/scratch
> > > 
> > >   btrfs/012       [failed, exit status 1]- output mismatch (see /home/adam/xfstests/results//btrfs/012.out.bad)
> > >       --- tests/btrfs/012.out	2024-07-17 16:27:18.790000343 +0930
> > >       +++ /home/adam/xfstests/results//btrfs/012.out.bad	2025-09-15 16:32:55.185922173 +0930
> > >       @@ -1,7 +1,11 @@
> > >        QA output created by 012
> > >       +mount: /mnt/scratch: wrong fs type, bad option, bad superblock on /dev/mapper/test-scratch1, missing codepage or helper program, or other error.
> > >       +       dmesg(1) may have more information after failed mount system call.
> > >       +mkdir: cannot create directory '/mnt/scratch/stressdir': File exists
> > >       +umount: /mnt/scratch: not mounted.
> > >        Checking converted btrfs against the original one:
> > >       -OK
> > >       ...
> > >       (Run 'diff -u /home/adam/xfstests/tests/btrfs/012.out /home/adam/xfstests/results//btrfs/012.out.bad'  to see the entire diff)
> > > 
> > >   btrfs/136 3s ... - output mismatch (see /home/adam/xfstests/results//btrfs/136.out.bad)
> > >       --- tests/btrfs/136.out	2022-05-11 11:25:30.743333331 +0930
> > >       +++ /home/adam/xfstests/results//btrfs/136.out.bad	2025-09-19 07:00:00.395280850 +0930
> > >       @@ -1,2 +1,10 @@
> > >        QA output created by 136
> > >       +mount: /mnt/scratch: wrong fs type, bad option, bad superblock on /dev/mapper/test-scratch1, missing codepage or helper program, or other error.
> > >       +       dmesg(1) may have more information after failed mount system call.
> > >       +umount: /mnt/scratch: not mounted.
> > >       +mount: /mnt/scratch: wrong fs type, bad option, bad superblock on /dev/mapper/test-scratch1, missing codepage or helper program, or other error.
> > >       +       dmesg(1) may have more information after failed mount system call.
> > >       +umount: /mnt/scratch: not mounted.
> > >       ...
> > >       (Run 'diff -u /home/adam/xfstests/tests/btrfs/136.out /home/adam/xfstests/results//btrfs/136.out.bad'  to see the entire diff)
> > > 
> > > [CAUSE]
> > > Currently ext* doesn't support block size larger than page size, thus
> > > at mkfs time it will output the following warning:
> > > 
> > >   Warning: blocksize 8192 not usable on most systems.
> > >   mke2fs 1.47.3 (8-Jul-2025)
> > >   Warning: 8192-byte blocks too big for system (max 4096), forced to continue
> > > 
> > > Furthermore at ext* mount time it will fail with the following dmesg:
> > > 
> > >   EXT4-fs (loop0): bad block size 8192
> > > 
> > > [FIX]
> > > Check if the mount of the newly created ext* succeeded.
> > > 
> > > If not, since the only extra parameter for mkfs is the block size, we
> > > know it's some block size ext* not yet supported, and skip the test
> > > case.
> > > 
> > > Signed-off-by: Qu Wenruo <wqu@suse.com>
> > > ---
> > >   tests/btrfs/012 | 3 +++
> > >   tests/btrfs/136 | 3 +++
> > >   2 files changed, 6 insertions(+)
> > > 
> > > diff --git a/tests/btrfs/012 b/tests/btrfs/012
> > > index f41d7e4e..665831b9 100755
> > > --- a/tests/btrfs/012
> > > +++ b/tests/btrfs/012
> > > @@ -42,6 +42,9 @@ $MKFS_EXT4_PROG -F -b $BLOCK_SIZE $SCRATCH_DEV > $seqres.full 2>&1 || \
> > >   	_notrun "Could not create ext4 filesystem"
> > >   # Manual mount so we don't use -t btrfs or selinux context
> > >   mount -t ext4 $SCRATCH_DEV $SCRATCH_MNT
> > > +if [ $? -ne 0 ]; then
> > > +	_notrun "block size $BLOCK_SIZE is not supported by ext4"
> > > +fi
> > 
> > Hmm... the mount failure maybe not caused by the "$BLOCK_SIZE is not supported",
> > I'm wondering if this _notrun might ignore real bug. How about check the
> > "blocksize < pagesize" at least?
> 
> The only extra parameter passed to mkfs.ext* is "-b $BLOCKSIZE", and if it's
> really some bug inside e2fsprog and it only affects bs > ps, we're still
> going to miss the bug.
> 
> Is there any proper way to reliably check the supported block size of ext*?
> Like some sysfs knobs?

If there's not a proper way to check ext4 supports LBS, how about check
blocksize < pagesize" before _notrun directly, e.g:

  pz=$(_get_page_size)
  if [ $? -ne 0 -a $BLOCKSIZE -gt $pz ]

Thanks,
Zorro

> 
> Thanks,
> Qu
> 
> > 
> > >   echo "populating the initial ext fs:" >> $seqres.full
> > >   mkdir "$SCRATCH_MNT/$BASENAME"
> > > diff --git a/tests/btrfs/136 b/tests/btrfs/136
> > > index 65bbcf51..6b4b52e4 100755
> > > --- a/tests/btrfs/136
> > > +++ b/tests/btrfs/136
> > > @@ -45,6 +45,9 @@ $MKFS_EXT4_PROG -F -t ext3 -b $BLOCK_SIZE $SCRATCH_DEV > $seqres.full 2>&1 || \
> > >   # mount and populate non-extent file
> > >   mount -t ext3 $SCRATCH_DEV $SCRATCH_MNT
> > > +if [ $? -ne 0 ]; then
> > > +	_notrun "block size $BLOCK_SIZE is not supported by ext3"
> > > +fi
> > >   populate_data "$SCRATCH_MNT/ext3_ext4_data/ext3"
> > >   _scratch_unmount
> > > -- 
> > > 2.51.0
> > > 
> > > 
> > 
> > 
> 


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

* Re: [PATCH 1/3] btrfs/012 btrfs/136: skip the test if ext* doesn't support the block size
  2025-10-01 20:50       ` Zorro Lang
@ 2025-10-01 21:11         ` Qu Wenruo
  0 siblings, 0 replies; 11+ messages in thread
From: Qu Wenruo @ 2025-10-01 21:11 UTC (permalink / raw)
  To: Zorro Lang; +Cc: Qu Wenruo, linux-btrfs, fstests



在 2025/10/2 06:20, Zorro Lang 写道:
> On Mon, Sep 29, 2025 at 06:12:17AM +0930, Qu Wenruo wrote:
>>
>>
>> 在 2025/9/29 00:24, Zorro Lang 写道:
>>> On Fri, Sep 19, 2025 at 08:13:25AM +0930, Qu Wenruo wrote:
>>>> [FALSE ALERT]
>>>> When testing btrfs bs > ps support, the test cases btrfs/012 and
>>>> btrfs/136 fail like the following:
>>>>
>>>>    FSTYP         -- btrfs
>>>>    PLATFORM      -- Linux/x86_64 btrfs-vm 6.17.0-rc4-custom+ #285 SMP PREEMPT_DYNAMIC Mon Sep 15 14:40:01 ACST 2025
>>>>    MKFS_OPTIONS  -- -s 8k /dev/mapper/test-scratch1
>>>>    MOUNT_OPTIONS -- /dev/mapper/test-scratch1 /mnt/scratch
>>>>
>>>>    btrfs/012       [failed, exit status 1]- output mismatch (see /home/adam/xfstests/results//btrfs/012.out.bad)
>>>>        --- tests/btrfs/012.out	2024-07-17 16:27:18.790000343 +0930
>>>>        +++ /home/adam/xfstests/results//btrfs/012.out.bad	2025-09-15 16:32:55.185922173 +0930
>>>>        @@ -1,7 +1,11 @@
>>>>         QA output created by 012
>>>>        +mount: /mnt/scratch: wrong fs type, bad option, bad superblock on /dev/mapper/test-scratch1, missing codepage or helper program, or other error.
>>>>        +       dmesg(1) may have more information after failed mount system call.
>>>>        +mkdir: cannot create directory '/mnt/scratch/stressdir': File exists
>>>>        +umount: /mnt/scratch: not mounted.
>>>>         Checking converted btrfs against the original one:
>>>>        -OK
>>>>        ...
>>>>        (Run 'diff -u /home/adam/xfstests/tests/btrfs/012.out /home/adam/xfstests/results//btrfs/012.out.bad'  to see the entire diff)
>>>>
>>>>    btrfs/136 3s ... - output mismatch (see /home/adam/xfstests/results//btrfs/136.out.bad)
>>>>        --- tests/btrfs/136.out	2022-05-11 11:25:30.743333331 +0930
>>>>        +++ /home/adam/xfstests/results//btrfs/136.out.bad	2025-09-19 07:00:00.395280850 +0930
>>>>        @@ -1,2 +1,10 @@
>>>>         QA output created by 136
>>>>        +mount: /mnt/scratch: wrong fs type, bad option, bad superblock on /dev/mapper/test-scratch1, missing codepage or helper program, or other error.
>>>>        +       dmesg(1) may have more information after failed mount system call.
>>>>        +umount: /mnt/scratch: not mounted.
>>>>        +mount: /mnt/scratch: wrong fs type, bad option, bad superblock on /dev/mapper/test-scratch1, missing codepage or helper program, or other error.
>>>>        +       dmesg(1) may have more information after failed mount system call.
>>>>        +umount: /mnt/scratch: not mounted.
>>>>        ...
>>>>        (Run 'diff -u /home/adam/xfstests/tests/btrfs/136.out /home/adam/xfstests/results//btrfs/136.out.bad'  to see the entire diff)
>>>>
>>>> [CAUSE]
>>>> Currently ext* doesn't support block size larger than page size, thus
>>>> at mkfs time it will output the following warning:
>>>>
>>>>    Warning: blocksize 8192 not usable on most systems.
>>>>    mke2fs 1.47.3 (8-Jul-2025)
>>>>    Warning: 8192-byte blocks too big for system (max 4096), forced to continue
>>>>
>>>> Furthermore at ext* mount time it will fail with the following dmesg:
>>>>
>>>>    EXT4-fs (loop0): bad block size 8192
>>>>
>>>> [FIX]
>>>> Check if the mount of the newly created ext* succeeded.
>>>>
>>>> If not, since the only extra parameter for mkfs is the block size, we
>>>> know it's some block size ext* not yet supported, and skip the test
>>>> case.
>>>>
>>>> Signed-off-by: Qu Wenruo <wqu@suse.com>
>>>> ---
>>>>    tests/btrfs/012 | 3 +++
>>>>    tests/btrfs/136 | 3 +++
>>>>    2 files changed, 6 insertions(+)
>>>>
>>>> diff --git a/tests/btrfs/012 b/tests/btrfs/012
>>>> index f41d7e4e..665831b9 100755
>>>> --- a/tests/btrfs/012
>>>> +++ b/tests/btrfs/012
>>>> @@ -42,6 +42,9 @@ $MKFS_EXT4_PROG -F -b $BLOCK_SIZE $SCRATCH_DEV > $seqres.full 2>&1 || \
>>>>    	_notrun "Could not create ext4 filesystem"
>>>>    # Manual mount so we don't use -t btrfs or selinux context
>>>>    mount -t ext4 $SCRATCH_DEV $SCRATCH_MNT
>>>> +if [ $? -ne 0 ]; then
>>>> +	_notrun "block size $BLOCK_SIZE is not supported by ext4"
>>>> +fi
>>>
>>> Hmm... the mount failure maybe not caused by the "$BLOCK_SIZE is not supported",
>>> I'm wondering if this _notrun might ignore real bug. How about check the
>>> "blocksize < pagesize" at least?
>>
>> The only extra parameter passed to mkfs.ext* is "-b $BLOCKSIZE", and if it's
>> really some bug inside e2fsprog and it only affects bs > ps, we're still
>> going to miss the bug.
>>
>> Is there any proper way to reliably check the supported block size of ext*?
>> Like some sysfs knobs?
> 
> If there's not a proper way to check ext4 supports LBS, how about check
> blocksize < pagesize" before _notrun directly, e.g:
> 
>    pz=$(_get_page_size)
>    if [ $? -ne 0 -a $BLOCKSIZE -gt $pz ]

OK, I'll just add the manual block size check.

Thanks,
Qu

> 
> Thanks,
> Zorro
> 
>>
>> Thanks,
>> Qu
>>
>>>
>>>>    echo "populating the initial ext fs:" >> $seqres.full
>>>>    mkdir "$SCRATCH_MNT/$BASENAME"
>>>> diff --git a/tests/btrfs/136 b/tests/btrfs/136
>>>> index 65bbcf51..6b4b52e4 100755
>>>> --- a/tests/btrfs/136
>>>> +++ b/tests/btrfs/136
>>>> @@ -45,6 +45,9 @@ $MKFS_EXT4_PROG -F -t ext3 -b $BLOCK_SIZE $SCRATCH_DEV > $seqres.full 2>&1 || \
>>>>    # mount and populate non-extent file
>>>>    mount -t ext3 $SCRATCH_DEV $SCRATCH_MNT
>>>> +if [ $? -ne 0 ]; then
>>>> +	_notrun "block size $BLOCK_SIZE is not supported by ext3"
>>>> +fi
>>>>    populate_data "$SCRATCH_MNT/ext3_ext4_data/ext3"
>>>>    _scratch_unmount
>>>> -- 
>>>> 2.51.0
>>>>
>>>>
>>>
>>>
>>
> 


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

end of thread, other threads:[~2025-10-01 21:11 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` [PATCH 2/3] btrfs/192 btrfs/30[456]: explicitly specify block size to avoid false alerts Qu Wenruo
2025-09-28 14:12   ` 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

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