[PATCH 1/4] btrfs: require no nodatacow for tests that exercise compression

fdmanana
2024-02-01T18:04:04Z

Several test cases fail when running with MOUNT_OPTIONS="-o nodatacow"
because they attempt to use compression and compression can not be
enabled on nodatacow files (it fails with -EINVAL). So make sure those
tests are not run if nodatacow is specified in MOUNT_OPTIONS.

Signed-off-by: Filipe Manana <fdmanana@suse.com>
---
tests/btrfs/024 | 1 +
tests/btrfs/048 | 1 +
tests/btrfs/059 | 1 +
tests/btrfs/138 | 1 +
tests/btrfs/234 | 1 +
tests/btrfs/281 | 1 +
6 files changed, 6 insertions(+)

diff --git a/tests/btrfs/024 b/tests/btrfs/024
index 95c734ec..a8ca0e1d 100755
--- a/tests/btrfs/024
+++ b/tests/btrfs/024
@@ -17,6 +17,7 @@ _begin_fstest auto quick compress
# real QA test starts here
_supported_fs btrfs
_require_scratch
+_require_btrfs_no_nodatacow

__workout()
{
diff --git a/tests/btrfs/048 b/tests/btrfs/048
index 8a88b8cc..aa2030b1 100755
--- a/tests/btrfs/048
+++ b/tests/btrfs/048
@@ -30,6 +30,7 @@ _require_test
_require_scratch
_require_btrfs_command "property"
_require_btrfs_command inspect-internal dump-super
+_require_btrfs_no_nodatacow

send_files_dir=$TEST_DIR/btrfs-test-$seq

diff --git a/tests/btrfs/059 b/tests/btrfs/059
index 76a1e76e..8b458b34 100755
--- a/tests/btrfs/059
+++ b/tests/btrfs/059
@@ -28,6 +28,7 @@ _supported_fs btrfs
_require_test
_require_scratch
_require_btrfs_command "property"
+_require_btrfs_no_nodatacow

_scratch_mkfs >> $seqres.full 2>&1
_scratch_mount
diff --git a/tests/btrfs/138 b/tests/btrfs/138
index f99e58e7..427fdede 100755
--- a/tests/btrfs/138
+++ b/tests/btrfs/138
@@ -18,6 +18,7 @@ _begin_fstest auto compress
_supported_fs btrfs
_require_scratch
_require_btrfs_command property
+_require_btrfs_no_nodatacow

algos=($(_btrfs_compression_algos))

diff --git a/tests/btrfs/234 b/tests/btrfs/234
index c045ea6c..542515e8 100755
--- a/tests/btrfs/234
+++ b/tests/btrfs/234
@@ -18,6 +18,7 @@ _begin_fstest auto quick compress rw
_supported_fs btrfs
_require_scratch
_require_odirect
+_require_btrfs_no_nodatacow
_require_chattr c

_scratch_mkfs >>$seqres.full 2>&1
diff --git a/tests/btrfs/281 b/tests/btrfs/281
index 63fb89ea..64075225 100755
--- a/tests/btrfs/281
+++ b/tests/btrfs/281
@@ -25,6 +25,7 @@ _require_scratch_reflink
_require_btrfs_send_v2
_require_xfs_io_command "fiemap"
_require_fssum
+_require_btrfs_no_nodatacow

_fixed_by_kernel_commit a11452a3709e \
"btrfs: send: avoid unaligned encoded writes when attempting to clone range"
--
2.40.1