diff mbox series

[v2,5/8] btrfs/205: skip test when running with nodatasum mount option

Message ID dc61c4474930cb42142081be5c18245551efcde8.1739403114.git.fdmanana@suse.com (mailing list archive)
State New
Headers show
Series [v2,1/8] btrfs: skip tests incompatible with compression when compression is enabled | expand

Commit Message

Filipe Manana Feb. 12, 2025, 11:35 p.m. UTC
From: Filipe Manana <fdmanana@suse.com>

Currently the test fails when we pass "-o nodatasum" in MOUNT_OPTIONS and
the reason is because we enable compression, with "chattr +c", on a file
and then try to clone from it to a file with nodatasum inherited from the
mount options, which results in the clone ioctl to fail with -EINVAL since
it's not possible to clone from datasum to nodatasum and vice-versa.

So skip the test if nodatasum is a mount option.

Signed-off-by: Filipe Manana <fdmanana@suse.com>
---
 tests/btrfs/205 | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Johannes Thumshirn Feb. 13, 2025, 9:40 a.m. UTC | #1
Looks good,
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
diff mbox series

Patch

diff --git a/tests/btrfs/205 b/tests/btrfs/205
index 13a1df8b..a557ab14 100755
--- a/tests/btrfs/205
+++ b/tests/btrfs/205
@@ -24,6 +24,11 @@  _require_xfs_io_command "falloc" "-k"
 _require_command "$CHATTR_PROG" chattr
 _require_btrfs_fs_feature "no_holes"
 _require_btrfs_mkfs_feature "no-holes"
+# We want to create a compressed inline extent representing 4K of data for file
+# foo1 and then clone it into a file without compression, and since compression
+# implies datasum, cloning fails if the destination file has nodatasum. So skip
+# the test if nodatasum is present in MOUNT_OPTIONS.
+_require_btrfs_no_nodatasum
 
 run_tests()
 {