From 83120248d03080fca910205b2862a6b7ae5a6792 Mon Sep 17 00:00:00 2001 From: Mark Harmstone Date: Thu, 24 Oct 2024 12:41:28 +0100 Subject: [PATCH] btrfs-progs: add an image explicit hole to fsck-tests/065-valid-log-tree Adds a test that btrfs check doesn't flag a file extent in the log tree as an error because of no corresponding csum entry, if the file extent is actually an explicit hole. See commit f6dc0e86. The log tree in hole.img.xz: log tree key (TREE_LOG ROOT_ITEM 5) leaf 5373952 items 3 free space 15981 generation 7 owner TREE_LOG leaf 5373952 flags 0x1(WRITTEN) backref revision 1 checksum stored 091c2f32 checksum calced 091c2f32 fs uuid 70d417f0-0173-49ca-bdf1-b789a798974d chunk uuid b7ec3806-ea09-4f18-a5ef-126a2d79105e item 0 key (257 INODE_ITEM 0) itemoff 16123 itemsize 160 generation 7 transid 7 size 4096 nbytes 0 block group 0 mode 100644 links 1 uid 0 gid 0 rdev 0 sequence 1 flags 0x0(none) atime 1721050040.375996658 (2024-07-15 14:27:20) ctime 1721050040.375996658 (2024-07-15 14:27:20) mtime 1721050040.375996658 (2024-07-15 14:27:20) otime 0.2820488960 (1970-01-01 01:00:00) item 1 key (257 INODE_REF 256) itemoff 16109 itemsize 14 index 2 namelen 4 name: file item 2 key (257 EXTENT_DATA 0) itemoff 16056 itemsize 53 generation 7 type 1 (regular) extent data disk byte 0 nr 0 extent data offset 0 nr 4096 ram 4096 extent compression 0 (none) Signed-off-by: Mark Harmstone [ Move the image to 065-valid-log tree ] Signed-off-by: Qu Wenruo --- tests/fsck-tests/065-valid-log-tree/hole.img.xz | Bin 0 -> 1292 bytes tests/fsck-tests/065-valid-log-tree/test.sh | 13 +++++++++++++ 2 files changed, 13 insertions(+) create mode 100644 tests/fsck-tests/065-valid-log-tree/hole.img.xz create mode 100755 tests/fsck-tests/065-valid-log-tree/test.sh diff --git a/tests/fsck-tests/065-valid-log-tree/hole.img.xz b/tests/fsck-tests/065-valid-log-tree/hole.img.xz new file mode 100644 index 0000000000000000000000000000000000000000..bdbc53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)x_;zf8MSLSkP%xHbqHWuGK7Y zj0deOw%P7c_kR;L;k2*50001drhCs%iJ`av0p|&Ts0#qT{=yuw#Ao{g000001X)^X C6K#?J literal 0 HcmV?d00001 diff --git a/tests/fsck-tests/065-valid-log-tree/test.sh b/tests/fsck-tests/065-valid-log-tree/test.sh new file mode 100755 index 00000000..b9221a4c --- /dev/null +++ b/tests/fsck-tests/065-valid-log-tree/test.sh @@ -0,0 +1,13 @@ +#!/bin/bash +# +# Verify that check doesn't cause false alerts on various valid log trees + +source "$TEST_TOP/common" || exit + +check_prereq btrfs + +check_image() { + run_check "$TOP/btrfs" check "$1" +} + +check_all_images