]> www.infradead.org Git - users/hch/xfstests-dev.git/commitdiff
btrfs/205: skip test when running with nodatasum mount option
authorFilipe Manana <fdmanana@suse.com>
Wed, 12 Feb 2025 23:35:03 +0000 (23:35 +0000)
committerZorro Lang <zlang@kernel.org>
Fri, 14 Feb 2025 19:21:18 +0000 (03:21 +0800)
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>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
tests/btrfs/205

index 13a1df8b9317a935a337aac372159ea4395e6b2a..a557ab149956048dc89ee2eb49d43917e93cac48 100755 (executable)
@@ -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()
 {