linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Qu Wenruo <quwenruo.btrfs@gmx.com>
To: Zorro Lang <zlang@redhat.com>, Qu Wenruo <wqu@suse.com>
Cc: linux-btrfs@vger.kernel.org, fstests@vger.kernel.org
Subject: Re: [PATCH 1/3] btrfs/012 btrfs/136: skip the test if ext* doesn't support the block size
Date: Mon, 29 Sep 2025 06:12:17 +0930	[thread overview]
Message-ID: <471b4e77-a89a-4cc2-aafe-0c04e36036c9@gmx.com> (raw)
In-Reply-To: <20250928145453.wyztv2kvfpgmlw3k@dell-per750-06-vm-08.rhts.eng.pek2.redhat.com>



在 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
>>
>>
> 
> 


  reply	other threads:[~2025-09-28 20:42 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 [this message]
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 1/3] btrfs/012 btrfs/136: skip the test if ext* doesn't support the block size 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=471b4e77-a89a-4cc2-aafe-0c04e36036c9@gmx.com \
    --to=quwenruo.btrfs@gmx.com \
    --cc=fstests@vger.kernel.org \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=wqu@suse.com \
    --cc=zlang@redhat.com \
    /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).