public inbox for fstests@vger.kernel.org
 help / color / mirror / Atom feed
From: Qu Wenruo <wqu@suse.com>
To: linux-btrfs@vger.kernel.org, fstests@vger.kernel.org
Subject: [PATCH] fstests: generic/746: skip if btrfs' new block-group-tree is involved
Date: Fri, 28 Nov 2025 08:00:52 +1030	[thread overview]
Message-ID: <20251127213052.15859-1-wqu@suse.com> (raw)

[FALSE ALERT]
The test case will fail on btrfs if the new block-group-tree feature is
enabled:

FSTYP         -- btrfs
PLATFORM      -- Linux/x86_64 btrfs-vm 6.18.0-rc6-custom+ #321 SMP PREEMPT_DYNAMIC Sun Nov 23 16:34:33 ACDT 2025
MKFS_OPTIONS  -- -O block-group-tree /dev/mapper/test-scratch1
MOUNT_OPTIONS -- /dev/mapper/test-scratch1 /mnt/scratch

generic/746 44s ... [failed, exit status 1]- output mismatch (see xfstests-dev/results//generic/746.out.bad)
    --- tests/generic/746.out	2024-06-27 13:55:51.286338519 +0930
    +++ xfstests-dev/results//generic/746.out.bad	2025-11-28 07:47:17.039827837 +1030
    @@ -2,4 +2,4 @@
     Generating garbage on loop...done.
     Running fstrim...done.
     Detecting interesting holes in image...done.
    -Comparing holes to the reported space from FS...done.
    +Comparing holes to the reported space from FS...Sectors 256-2111 are not marked as free!
    ...
    (Run 'diff -u xfstests-dev/tests/generic/746.out xfstests-dev/results//generic/746.out.bad'  to see the entire diff)

[CAUSE]
Sectors [256, 2048) are the reserved 1M free space.
Sectors [2048, 2112) are the leading free space in the chunk tree.
Sectors [2112, 1244) is the first tree block in the chunk tree.

The reported free sectors from get_free_sectors() looks like this:

  2144 10566
  10688 11711
  ...

Note that there should be a free sector range in [2048, 2122) but it's
not reported in get_free_sectors().

The get_free_sectors() call is fs dependent, and for btrfs it's using
parse-extent-tree.awk script to handle the extent tree dump.

The script uses BLOCK_GROUP_ITEM items to detect the beginning of a
block group so that it can calculate the hole between the bginning of a
block group and the first data/metadata item.

However block-group-tree feature moves BLOCK_GROUP_ITEM items to a
dedicated tree, making the existing script unable to parse the free
space at the beginning of a block group.

[FIX]
For block-group-tree feature, we need to parse both block group tree and
extent tree and do cross-reference.
It is not that simple to do in a single awk script, so unfortunately
skip the test if the btrfs has block-group-tree feature enabled.

Signed-off-by: Qu Wenruo <wqu@suse.com>
---
 tests/generic/746 | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/tests/generic/746 b/tests/generic/746
index 6f02b1cc..c62fdbc9 100755
--- a/tests/generic/746
+++ b/tests/generic/746
@@ -162,6 +162,18 @@ mkdir $loop_mnt
 _mkfs_dev $loop_dev
 _mount $loop_dev $loop_mnt
 
+# The new block-group-tree will feature screw up the extent tree parsing, as
+# there is no more block group item in that tree to mark the start
+# of a block group, causing the free space between the beginning of bg
+# and the first data/metadata block not counted as free space.
+# So reject fs with block-group-tree feature for now.
+if [ $FSTYP = "btrfs" ]; then
+	if $BTRFS_UTIL_PROG inspect-internal dump-super $loop_dev |\
+		grep -q BLOCK_GROUP_TREE; then
+		_notrun "No support for block-group-tree extent tree parsing yet"
+	fi
+fi
+
 echo -n "Generating garbage on loop..."
 # Goal is to fill it up, ignore any errors.
 for i in `seq 1 10`; do
-- 
2.51.2


                 reply	other threads:[~2025-11-27 21:31 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20251127213052.15859-1-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