]> www.infradead.org Git - users/hch/xfstests-dev.git/commitdiff
btrfs/299: skip test if we were mounted with nodatacow
authorFilipe Manana <fdmanana@suse.com>
Thu, 1 Feb 2024 18:03:49 +0000 (18:03 +0000)
committerZorro Lang <zlang@kernel.org>
Fri, 1 Mar 2024 11:24:16 +0000 (19:24 +0800)
The test requires the ability to create an inline extent in a file with
a prealloced extent, created with fallocate's FALLOC_FL_KEEP_SIZE mode,
which can only happen when COW is enabled. If the test is run with
MOUNT_OPTIONS="-o nodatacow", then COW never happens as all writes end
up using the preallocated extent. This results in the logical-resolve
command to return one file path when it should return none, since the
base logical address of the prealloc extent is still in use unless COW
happens.

So make the test not run if nodatacow is specified in MOUNT_OPTIONS.

Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Disseldorp <ddiss@suse.de>
Signed-off-by: Zorro Lang <zlang@kernel.org>
tests/btrfs/299

index c4b1c7c544f7d40ee9fe1edd33393936854f0078..d38bf2ac1c863b19901977c9130fc74a19497998 100755 (executable)
@@ -23,6 +23,9 @@ _supported_fs btrfs
 _require_scratch
 _require_xfs_io_command "falloc" "-k"
 _require_btrfs_command inspect-internal logical-resolve
+# Can't run with nodatacow because we need to be able to create an inline extent
+# in a range with a prealloc extent, which can only happen with COW enabled.
+_require_btrfs_no_nodatacow
 _fixed_by_kernel_commit 560840afc3e6 \
        "btrfs: fix resolving backrefs for inline extent followed by prealloc"