btrfs: make nospace_cache related test cases to work with latest v2 cache
authorQu Wenruo <wqu@suse.com>
Sun, 14 Nov 2021 12:51:01 +0000 (20:51 +0800)
committerEryu Guan <guaneryu@gmail.com>
Sun, 14 Nov 2021 13:00:23 +0000 (21:00 +0800)
commitff0409f6b57689f7f9db13ef8dbf939155be21ee
tree9b749fae1d55d421b96566f8b254febb8d6a641a
parentbf3d7aba247d9ea89d4bf50ead44f2964237ead5
btrfs: make nospace_cache related test cases to work with latest v2 cache

In the coming btrfs-progs v5.15 release, mkfs.btrfs will change to
use v2 cache by default.

However nospace_cache mount option will not work with v2 cache, as
it would make v2 cache out of sync with on-disk used space.

So mounting a btrfs with v2 cache using "nospace_cache" will make
btrfs to reject the mount.

There are quite some test cases relying on nospace_cache to prevent
v1 cache to take up data space.

For those test cases, we no longer need the "nospace_cache" mount
option if the filesystem is already using v2 cache. Since v2 cache
is using metadata space, it will no longer take up data space, thus
no extra mount options for those test cases.

By this, we can keep those existing tests to run without problem for
both v1 and v2 cache.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
12 files changed:
common/btrfs
tests/btrfs/102
tests/btrfs/140
tests/btrfs/141
tests/btrfs/142
tests/btrfs/143
tests/btrfs/151
tests/btrfs/157
tests/btrfs/158
tests/btrfs/170
tests/btrfs/199
tests/btrfs/215