[PATCH] fstests: btrfs/138: add requirement for datacsum

Qu Wenruo <[email protected]>
Newsgroups org.kernel.vger.fstests,org.kernel.vger.linux-btrfs
Message-ID <[email protected]>
[FALSE ALERT]
If one has specified "-o nodatasum" as mount options, the test case
btrfs/138 will fail with the following error:

 MOUNT_OPTIONS -- -o nodatasum /dev/mapper/test-scratch1 /mnt/scratch

 btrfs/138    34s ... - output mismatch (see /home/adam/xfstests/results//btrfs/138.out.bad)
    --- tests/btrfs/138.out	2022-05-11 11:25:30.743333331 +0930
    +++ /home/adam/xfstests/results//btrfs/138.out.bad	2026-06-08 09:04:30.627143086 +0930
    @@ -1,2 +1,5 @@
     QA output created by 138
    +ERROR: failed to set compression for /mnt/scratch/zlib: Invalid argument
    +ERROR: failed to set compression for /mnt/scratch/lzo: Invalid argument
    +ERROR: failed to set compression for /mnt/scratch/zstd: Invalid argument
     Silence is golden
    ...

[CAUSE]
Btrfs compression requires both datacow and datasum, thus nodatasum
mount option will reject compression completely, causing the above
failures.

[FIX]
Add _require_btrfs_no_nodatasum for the test case, so that for nodatasum
mount option the test case can be properly skipped other than causing
false failure.

Signed-off-by: Qu Wenruo <[email protected]>
---
 tests/btrfs/138 | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tests/btrfs/138 b/tests/btrfs/138
index 17bbe28e..57ab1bd3 100755
--- a/tests/btrfs/138
+++ b/tests/btrfs/138
@@ -15,6 +15,7 @@ _begin_fstest auto compress
 _require_scratch
 _require_btrfs_command property
 _require_btrfs_no_nodatacow
+_require_btrfs_no_nodatasum
 
 algos=($(_btrfs_compression_algos))
 
-- 
2.51.2
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.