From 263184c7d286efe5200939686818400d0e3afa5d Mon Sep 17 00:00:00 2001 From: Qu Wenruo Date: Wed, 22 Nov 2017 17:03:25 +0800 Subject: btrfs-progs: fsck-tests: Introduce test case with keyed data backref with shared tree blocks For snapshot shared tree blocks with source subvolume, the keyed backref counter only counts the exclusive owned references. In the following case, 258 is a snapshot of 257, which inherits all the reference to this data extent. ------ item 4 key (12582912 EXTENT_ITEM 524288) itemoff 3741 itemsize 140 refs 179 gen 9 flags DATA extent data backref root 257 objectid 258 offset 0 count 49 extent data backref root 257 objectid 257 offset 0 count 1 extent data backref root 256 objectid 258 offset 0 count 128 extent data backref root 256 objectid 257 offset 0 count 1 ------ However lowmem mode used to iterate the whole inode to find all references, and doesn't care if a reference is already counted by the shared tree block. Add the test case to check it. Signed-off-by: Qu Wenruo Signed-off-by: David Sterba --- .../keyed_data_ref_with_shared_leaf.img | Bin 0 -> 19456 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 tests/fsck-tests/020-extent-ref-cases/keyed_data_ref_with_shared_leaf.img (limited to 'tests/fsck-tests') diff --git a/tests/fsck-tests/020-extent-ref-cases/keyed_data_ref_with_shared_leaf.img b/tests/fsck-tests/020-extent-ref-cases/keyed_data_ref_with_shared_leaf.img new file mode 100644 index 00000000..2ce5068f Binary files /dev/null and b/tests/fsck-tests/020-extent-ref-cases/keyed_data_ref_with_shared_leaf.img differ -- cgit v1.2.3