btrfs-progs/tests/fsck-tests
Qu Wenruo 208073c373 btrfs-progs: tests: add test image of out-of-order inline backref items
Issue #622 reported a case where ntfs2btrfs can generate out-of-order
inline backref items, which can lead to kernel transaction abort, but
not detected by btrfs-check.

This patch would add such image, whose extent tree looks like this for
the only data extent:

        item 0 key (13631488 EXTENT_ITEM 4096) itemoff 16172 itemsize 111
                refs 3 gen 7 flags DATA
                (178 0xdfb591fa80d95ea) extent data backref root FS_TREE objectid 257 offset 0 count 1
                (178 0xdfb591fbbf5f519) extent data backref root FS_TREE objectid 258 offset 0 count 1
                (178 0xdfb591f49f9f8e7) extent data backref root FS_TREE objectid 259 offset 0 count 1

While the original good base image has the following backrefs for the
same data extent:

        item 0 key (13631488 EXTENT_ITEM 4096) itemoff 16172 itemsize 111
                refs 3 gen 7 flags DATA
                (178 0xdfb591fbbf5f519) extent data backref root FS_TREE objectid 258 offset 0 count 1
                (178 0xdfb591fa80d95ea) extent data backref root FS_TREE objectid 257 offset 0 count 1
                (178 0xdfb591f49f9f8e7) extent data backref root FS_TREE objectid 259 offset 0 count 1

Notice the sequence (the 2nd number in the round brackets) should be
descending.  (Meanwhile type should be ascending, but it's way harder to
create.)

For now we don't have a way to fix it, but at least we should detect it.

Issue: #622
Reviewed-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2023-11-03 18:04:37 +01:00
..
001-bad-file-extent-bytenr
002-bad-transid
003-shift-offsets
004-no-dir-index
005-bad-item-offset
006-bad-root-items
007-bad-offset-snapshots
008-bad-dir-index-name
009-no-dir-item-or-index
010-no-rootdir-inode-item
011-no-inode-item
012-leaf-corruption
013-extent-tree-rebuild
014-no-extent-info
016-wrong-inode-nbytes
017-missing-all-file-extent
018-leaf-crossing-stripes
019-non-skinny-false-alert
020-extent-ref-cases
021-partially-dropped-snapshot-case
022-qgroup-rescan-halfway
023-qgroup-stack-overflow
024-clear-space-cache
025-file-extents
026-bad-dir-item-name
027-bad-extent-inline-ref-type
028-unaligned-super-dev-sizes
029-valid-orphan-item
030-reflinked-prealloc-extents
031-metadatadump-check-data-csum btrfs-progs: tests: use _mktemp_local for temporary files 2022-10-11 09:06:13 +02:00
032-corrupted-qgroup
033-lowmem-collission-dir-items
034-bad-inode-flags
035-inline-bad-ram-bytes
036-bad-dev-extents
036-rescan-not-kicked-in
037-freespacetree-repair
038-missing-one-file-extent
039-bad-inode-mode
040-compressed-nodatasum
041-invalid-root-generation
042-half-dropped-inode
043-bad-inode-generation
044-invalid-extent-item-generation
045-overlap-csum-item
046-ino-cache-clean
047-dev-bytes-used
049-dir-hard-link
050-invalid-block-group-used
051-invalid-super-bytes-used
052-init-csum-tree
053-bad-metadata-level
054-orphan-directory
055-super-num-devs-mismatch
056-raid56-false-alerts btrfs-progs: tests: fix fsck-tests/056 to run without root 2023-04-12 01:56:28 +02:00
057-seed-false-alerts btrfs-progs: tests: fix fsck-tests/057 to run without root 2023-04-12 01:56:36 +02:00
058-bad-free-space-tree-entry
059-shrunk-device btrfs-progs: tests: fix fsck-tests/059 to run without root 2023-04-12 01:56:39 +02:00
060-degraded-check btrfs-progs: tests: fix fsck-tests/060 to run without root 2023-04-12 01:56:41 +02:00
061-out-of-order-inline-backref btrfs-progs: tests: add test image of out-of-order inline backref items 2023-11-03 18:04:37 +01:00