All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.com>
To: fstests@vger.kernel.org
Cc: Josef Bacik <josef@toxicpanda.com>, linux-btrfs@vger.kernel.org
Subject: [PATCH 6/8] btrfs/287,btrfs/293: filter all btrfs subvolume delete calls
Date: Tue,  5 Mar 2024 19:52:19 +0100	[thread overview]
Message-ID: <fc4d5270c569ef7d74066d7249a3f6669fb021fe.1709664047.git.dsterba@suse.com> (raw)
In-Reply-To: <cover.1709664047.git.dsterba@suse.com>

From: Josef Bacik <josef@toxicpanda.com>

Some of our btrfs subvolume delete calls get put into the golden output,
and many of them simply _filter_scratch.  This works fine, but we
recently changed btrfs subvolume delete output, and it would have been
nice to simply filter this in one place.  We have a
_filter_btrfs_subvol_delete helper, but it's only used in one place.
Fix all of these uses to call _filter_btrfs_subvol_delete, this will
allow for follow up fixes against _filter_btrfs_subvol_delete itself to
deal with changed output.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
---
 tests/btrfs/287     | 4 ++--
 tests/btrfs/287.out | 2 +-
 tests/btrfs/293     | 6 +++---
 tests/btrfs/293.out | 4 ++--
 4 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/tests/btrfs/287 b/tests/btrfs/287
index 04871d46036aa2..64e6ef35250c8e 100755
--- a/tests/btrfs/287
+++ b/tests/btrfs/287
@@ -9,7 +9,7 @@
 . ./common/preamble
 _begin_fstest auto quick snapshot clone punch logical_resolve
 
-. ./common/filter
+. ./common/filter.btrfs
 . ./common/reflink
 
 _supported_fs btrfs
@@ -148,7 +148,7 @@ echo "resolve second extent with ignore offset option:"
 query_logical_ino -o $second_extent_bytenr | filter_snapshot_ids
 
 # Now delete the first snapshot and repeat the last 2 queries.
-$BTRFS_UTIL_PROG subvolume delete -C $SCRATCH_MNT/snap1 | _filter_scratch
+$BTRFS_UTIL_PROG subvolume delete -C $SCRATCH_MNT/snap1 | _filter_btrfs_subvol_delete
 
 # Query the second extent with an offset of 0, should return file offsets 12M
 # and 20M for the default subvolume (root 5) and file offsets 4M, 12M and 20M
diff --git a/tests/btrfs/287.out b/tests/btrfs/287.out
index 0d69473364fa31..30eac8fa444c8f 100644
--- a/tests/btrfs/287.out
+++ b/tests/btrfs/287.out
@@ -79,7 +79,7 @@ inode 257 offset 4194304 snap1
 inode 257 offset 20971520 root 5
 inode 257 offset 12582912 root 5
 inode 257 offset 5242880 root 5
-Delete subvolume (commit): 'SCRATCH_MNT/snap1'
+Delete subvolume 'SCRATCH_MNT/snap1'
 resolve second extent:
 inode 257 offset 20971520 snap2
 inode 257 offset 12582912 snap2
diff --git a/tests/btrfs/293 b/tests/btrfs/293
index cded956468ee9a..06f96dc414b05b 100755
--- a/tests/btrfs/293
+++ b/tests/btrfs/293
@@ -18,7 +18,7 @@ _cleanup()
 	test -n "$swap_file" && swapoff $swap_file &> /dev/null
 }
 
-. ./common/filter
+. ./common/filter.btrfs
 
 _supported_fs btrfs
 _fixed_by_kernel_commit deccae40e4b3 \
@@ -40,7 +40,7 @@ echo "Activating swap file... (should fail due to snapshots)"
 _swapon_file $swap_file 2>&1 | _filter_scratch
 
 echo "Deleting first snapshot..."
-$BTRFS_UTIL_PROG subvolume delete -c $SCRATCH_MNT/snap1 | _filter_scratch
+$BTRFS_UTIL_PROG subvolume delete -c $SCRATCH_MNT/snap1 | _filter_btrfs_subvol_delete
 
 # We deleted the snapshot and committed the transaction used to delete it (-c),
 # but all its extents are actually only deleted in the background, by the cleaner
@@ -55,7 +55,7 @@ echo "Activating swap file... (should fail due to snapshot)"
 _swapon_file $swap_file 2>&1 | _filter_scratch
 
 echo "Deleting second snapshot..."
-$BTRFS_UTIL_PROG subvolume delete -c $SCRATCH_MNT/snap2 | _filter_scratch
+$BTRFS_UTIL_PROG subvolume delete -c $SCRATCH_MNT/snap2 | _filter_btrfs_subvol_delete
 
 echo "Remounting and waiting for cleaner thread to remove the second snapshot..."
 _scratch_remount commit=1
diff --git a/tests/btrfs/293.out b/tests/btrfs/293.out
index 2ac1663281947a..fd04ac9139b849 100644
--- a/tests/btrfs/293.out
+++ b/tests/btrfs/293.out
@@ -6,12 +6,12 @@ Create a snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap2'
 Activating swap file... (should fail due to snapshots)
 swapon: SCRATCH_MNT/swapfile: swapon failed: Invalid argument
 Deleting first snapshot...
-Delete subvolume (commit): 'SCRATCH_MNT/snap1'
+Delete subvolume 'SCRATCH_MNT/snap1'
 Remounting and waiting for cleaner thread to remove the first snapshot...
 Activating swap file... (should fail due to snapshot)
 swapon: SCRATCH_MNT/swapfile: swapon failed: Invalid argument
 Deleting second snapshot...
-Delete subvolume (commit): 'SCRATCH_MNT/snap2'
+Delete subvolume 'SCRATCH_MNT/snap2'
 Remounting and waiting for cleaner thread to remove the second snapshot...
 Activating swap file...
 Disabling swap file...
-- 
2.42.1


  parent reply	other threads:[~2024-03-05 18:59 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-05 18:51 [PATCH 0/8] Btrfs fstests fixups David Sterba
2024-03-05 18:52 ` [PATCH 1/8] btrfs/011: increase the runtime for replace cancel David Sterba
2024-03-05 18:52 ` [PATCH 2/8] btrfs/012: adjust how we populate the fs to convert David Sterba
2024-03-07  8:04   ` Anand Jain
2024-03-05 18:52 ` [PATCH 3/8] btrfs/131: don't run with subpage blocksizes David Sterba
2024-03-05 18:52 ` [PATCH 4/8] btrfs/213: make the test more reliable David Sterba
2024-03-05 18:52 ` [PATCH 5/8] btrfs/271: adjust failure condition David Sterba
2024-03-05 18:52 ` David Sterba [this message]
2024-03-05 18:52 ` [PATCH 7/8] btrfs/291: remove image file after teardown David Sterba
2024-03-05 18:52 ` [PATCH 8/8] btrfs/400: test normal qgroup operations in a compress friendly way David Sterba
2024-03-07 12:28 ` [PATCH 0/8] Btrfs fstests fixups Anand Jain

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=fc4d5270c569ef7d74066d7249a3f6669fb021fe.1709664047.git.dsterba@suse.com \
    --to=dsterba@suse.com \
    --cc=fstests@vger.kernel.org \
    --cc=josef@toxicpanda.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.