linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] btrfs-progs: tests/misc/030: do not require v1 cache for the test case
@ 2023-08-08  6:08 Qu Wenruo
  2023-08-09 13:18 ` Josef Bacik
  0 siblings, 1 reply; 2+ messages in thread
From: Qu Wenruo @ 2023-08-08  6:08 UTC (permalink / raw)
  To: linux-btrfs

[PROBLEM]
Since we have migrated to default v2 cache, the test case
misc/030-missing-device-image is no longer executed:

    [TEST/misc]   030-missing-device-image
    [NOTRUN] unable to create v1 space cache

[CAUSE]
The test case itself is trying its best to cover all paths, including
the data extent read path.

Thus the test case is requiring v1 cache, as that's the only way to
cover the data read path.

[FIX]
Just remove the v1 space cache requirement, it's still better to run the
test even it only exercises the metadata read path.

The good news is, after commit 3ff9d352576b ("btrfs-progs: use
read_data_from_disk() to replace read_extent_from_disk() and replace
read_extent_data()"), all data/metadata read paths are unified.
They only differ in the verification part.

Thus even if we didn't fully exercise the data read path, we didn't lose
much coverage anyway.

Signed-off-by: Qu Wenruo <wqu@suse.com>
---
 tests/misc-tests/030-missing-device-image/test.sh | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/tests/misc-tests/030-missing-device-image/test.sh b/tests/misc-tests/030-missing-device-image/test.sh
index be022c4bb9eb..1438f8a45229 100755
--- a/tests/misc-tests/030-missing-device-image/test.sh
+++ b/tests/misc-tests/030-missing-device-image/test.sh
@@ -37,14 +37,6 @@ test_missing()
 	run_check $SUDO_HELPER dd if=/dev/zero of="$TEST_MNT/b" bs=4k count=1000 conv=sync
 	run_check $SUDO_HELPER umount "$TEST_MNT"
 
-	# make sure we have space cache
-	if ! run_check_stdout "$TOP/btrfs" inspect dump-tree -t root "$dev1" |
-		grep -q "EXTENT_DATA"; then
-		# Normally the above operation should create the space cache.
-		# If not, it may mean we have migrated to v2 cache by default
-		_not_run "unable to create v1 space cache"
-	fi
-
 	# now wipe the device
 	run_check wipefs -fa "$bad_dev"
 
-- 
2.41.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] btrfs-progs: tests/misc/030: do not require v1 cache for the test case
  2023-08-08  6:08 [PATCH] btrfs-progs: tests/misc/030: do not require v1 cache for the test case Qu Wenruo
@ 2023-08-09 13:18 ` Josef Bacik
  0 siblings, 0 replies; 2+ messages in thread
From: Josef Bacik @ 2023-08-09 13:18 UTC (permalink / raw)
  To: Qu Wenruo; +Cc: linux-btrfs

On Tue, Aug 08, 2023 at 02:08:42PM +0800, Qu Wenruo wrote:
> [PROBLEM]
> Since we have migrated to default v2 cache, the test case
> misc/030-missing-device-image is no longer executed:
> 
>     [TEST/misc]   030-missing-device-image
>     [NOTRUN] unable to create v1 space cache
> 
> [CAUSE]
> The test case itself is trying its best to cover all paths, including
> the data extent read path.
> 
> Thus the test case is requiring v1 cache, as that's the only way to
> cover the data read path.
> 
> [FIX]
> Just remove the v1 space cache requirement, it's still better to run the
> test even it only exercises the metadata read path.
> 
> The good news is, after commit 3ff9d352576b ("btrfs-progs: use
> read_data_from_disk() to replace read_extent_from_disk() and replace
> read_extent_data()"), all data/metadata read paths are unified.
> They only differ in the verification part.
> 
> Thus even if we didn't fully exercise the data read path, we didn't lose
> much coverage anyway.
> 
> Signed-off-by: Qu Wenruo <wqu@suse.com>

Reviewed-by: Josef Bacik <josef@toxicpanda.com>

Thanks,

Josef

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-08-09 13:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-08  6:08 [PATCH] btrfs-progs: tests/misc/030: do not require v1 cache for the test case Qu Wenruo
2023-08-09 13:18 ` Josef Bacik

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).