Release fstests v2023.09.24
btrfs/287: filter snapshot IDs to avoid failures when using some features

When running btrfs/287 with features that create extra trees or don't
the need to create some trees, such as when using the free space tree
(default for several btrfs-progs releases now) versus when not using
it (by passing -R ^free-space-tree in MKFS_OPTIONS), the test can fail
because the IDs for the two snapshots it creates changes, and the golden
output is requiring the numeric IDs of the snapshots.

For example, when disabling the free space tree, the test fails like this:

  $ MKFS_OPTIONS="-R ^free-space-tree" ./check btrfs/287
  FSTYP         -- btrfs
  PLATFORM      -- Linux/x86_64 debian0 6.6.0-rc2-btrfs-next-138+ #1 SMP PREEMPT_DYNAMIC Thu Sep 21 17:58:48 WEST 2023
  MKFS_OPTIONS  -- -R ^free-space-tree /dev/sdc
  MOUNT_OPTIONS -- /dev/sdc /home/fdmanana/btrfs-tests/scratch_1

  btrfs/287 1s ... - output mismatch (see /home/fdmanana/git/hub/xfstests/results//btrfs/287.out.bad)
      --- tests/btrfs/287.out	2023-09-22 12:39:43.060761389 +0100
      +++ /home/fdmanana/git/hub/xfstests/results//btrfs/287.out.bad	2023-09-22 12:40:54.238849251 +0100
      @@ -44,52 +44,52 @@
       Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap1'
       Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap2'
       resolve first extent:
      -inode 257 offset 16777216 root 257
      -inode 257 offset 8388608 root 257
      -inode 257 offset 16777216 root 256
      -inode 257 offset 8388608 root 256
      ...
      (Run 'diff -u /home/fdmanana/git/hub/xfstests/tests/btrfs/287.out /home/fdmanana/git/hub/xfstests/results//btrfs/287.out.bad'  to see the entire diff)

  HINT: You _MAY_ be missing kernel fix:
        0cad8f14d70c btrfs: fix backref walking not returning all inode refs

  Ran: btrfs/287
  Failures: btrfs/287
  Failed 1 of 1 tests

So add a filter to logical reserve calls to replace snapshot root IDs with
a logical name (snap1 and snap2).

Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Disseldorp <ddiss@suse.de>
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
2 files changed