Re: [PATCH] btrfs/306: skip the run if block size is not 4K

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]



On Thu, Sep 18, 2025 at 12:03 PM Qu Wenruo <wqu@xxxxxxxx> wrote:
>
> [FALSE ALERT]
> When running btrfs with block size larger than 4K (e.g. 8K in this
> case), the test case will fail like this:
>
> 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/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)
>
> In the above case it's the experimental support of block size larger
> than page size.
> The feature is still under development.
>
> [CAUSE]
> That test case requires 4K block size, but it has no way to control
> that, as QA runners can specify MKFS_OPTIONS="-s 8k", to override the
> default block size.
>
> Normally this is impossible as on x86_64 the only supported block size is
> 4K, already the minimal block size of btrfs. So there is no way to use
> other block size in that test case.
>
> However with the experiemental bs > ps support, even on x86_64 it's

type in experimental

> possible to use 8K block size, and that breaks the 4K block size
> assumption of the test case.
>
> [FIX]
> Add a quick scratch mkfs, and grab the block size of the resulted fs.

resulted -> resulting

> If the block size is not 4K, skip the run.
>
> Since we're here, also remove the page size check, since we have subpage
> block size support for a while, and replace it with a more accurate
> supported sectorsize check.
>
> This more accurate sectorsize support now allows aarch64 (64K page size)
> to run btrfs/306 successfully, improving the subpage bs support coverage.
>
> Signed-off-by: Qu Wenruo <wqu@xxxxxxxx>
> ---
>  tests/btrfs/306 | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/tests/btrfs/306 b/tests/btrfs/306
> index b47c446b..879f67b4 100755
> --- a/tests/btrfs/306
> +++ b/tests/btrfs/306
> @@ -21,8 +21,13 @@ _require_btrfs_fs_feature "raid_stripe_tree"
>  _require_btrfs_fs_feature "free_space_tree"
>  _require_btrfs_free_space_tree
>  _require_btrfs_no_compress
> +_require_btrfs_support_sectorsize 4096
>
> -test $(_get_page_size) -eq 4096 || _notrun "this tests requires 4k pagesize"
> +_scratch_mkfs >> /dev/null
> +blksz=$(_scratch_btrfs_sectorsize)
> +if [ $blksz -ne 4096 ]; then
> +       _notrun "this tests require blocksize 4096, has $blksz"
> +fi

should be "this test requires a block size of 4096 bytes, have $blocksize"

So at least 3 of the raid stripe tree tests, from btrfs/304,305,306
require the same exact fix, why not combine all the fixes in a single
patch?
You've sent patches for the other two that do exactly the same.

Thanks.

>
>  test_4k_write_64koff()
>  {

> --
> 2.51.0
>
>





[Index of Archives]     [Linux Filesystems Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux