diff mbox series

[v2,2/8] btrfs/290: skip test if we are running with nodatacow mount option

Message ID c237eac9f459e96ea4737fbf18bc96b733a0ab9f.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>

We exercise corrupting an inline extent and inline extents can't be created
with nodatacow, we get instead a regular file extent item and if we attempt
to corrupt its disk_bytenr field with btrfs-corrupt-block we fail tree-checker
validation at mount time resulting in failure to mount and the following in
dmesg:

[514127.759739] BTRFS critical (device sdc): corrupt leaf: root=5 \
        block=30408704 slot=8 ino=257 file_offset=0, invalid disk_bytenr for \
        file extent, have 7416089308958521981, should be aligned to 4096
[514127.762715] BTRFS error (device sdc): read time tree block corruption \
        detected on logical 30408704 mirror 1

So add a _require_btrfs_no_nodatacow call to the test.

Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
---
 tests/btrfs/290 | 12 ++++++++++++
 1 file changed, 12 insertions(+)
diff mbox series

Patch

diff --git a/tests/btrfs/290 b/tests/btrfs/290
index 1a5e267b..04563dfe 100755
--- a/tests/btrfs/290
+++ b/tests/btrfs/290
@@ -30,6 +30,18 @@  _require_xfs_io_command "pread"
 _require_xfs_io_command "pwrite"
 _require_btrfs_corrupt_block "value"
 _require_btrfs_corrupt_block "offset"
+# We exercise corrupting an inline extent and inline extents can't be created
+# with nodatacow, we get instead a regular file extent item and if we attempt
+# to corrupt its disk_bytenr field with btrfs-corrupt-block we fail tree-checker
+# validation at mount time resulting in failure to mount and the following in
+# dmesg:
+#
+# [514127.759739] BTRFS critical (device sdc): corrupt leaf: root=5 \
+#         block=30408704 slot=8 ino=257 file_offset=0, invalid disk_bytenr for \
+#         file extent, have 7416089308958521981, should be aligned to 4096
+# [514127.762715] BTRFS error (device sdc): read time tree block corruption \
+#         detected on logical 30408704 mirror 1
+_require_btrfs_no_nodatacow
 _disable_fsverity_signatures
 
 get_ino() {