diff mbox series

[3/4] btrfs/299: skip test if we were mounted with nodatacow

Message ID 92cf2f68139e3e8488c09372ef1fd46443b3299b.1706810184.git.fdmanana@suse.com (mailing list archive)
State New, archived
Headers show
Series btrfs: make test pass or skip them when using nodatacow | expand

Commit Message

Filipe Manana Feb. 1, 2024, 6:03 p.m. UTC
From: Filipe Manana <fdmanana@suse.com>

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

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

Signed-off-by: Filipe Manana <fdmanana@suse.com>
 tests/btrfs/299 | 3 +++
 1 file changed, 3 insertions(+)
diff mbox series


diff --git a/tests/btrfs/299 b/tests/btrfs/299
index c4b1c7c5..d38bf2ac 100755
--- a/tests/btrfs/299
+++ b/tests/btrfs/299
@@ -23,6 +23,9 @@  _supported_fs btrfs
 _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.
 _fixed_by_kernel_commit 560840afc3e6 \
 	"btrfs: fix resolving backrefs for inline extent followed by prealloc"