btrfs-progs: fsck-test: Add new image with shared block ref only metadata backref
authorQu Wenruo <wqu@suse.com>
Wed, 22 Nov 2017 09:03:23 +0000 (17:03 +0800)
committerDavid Sterba <dsterba@suse.com>
Wed, 3 Jan 2018 16:09:23 +0000 (17:09 +0100)
commit95dd77e2d50f214a9e2d5ec09fb9db64e9d69818
treecbacfd83740a27342e1493803def8af8b07aeab1
parent0ad4f36bf387e3513b0401eed7abeda7bbffe4e1
btrfs-progs: fsck-test: Add new image with shared block ref only metadata backref

The image is dumped by modifying kernel to sleep long enough before
merging relocation trees, so we can just copy the whole image to other
place before kernel begins to merge reloc trees.

And the base image is created by the following script to bump metadata
size:
------
dev=~/test.img
mnt=/mnt/btrfs

umount $mnt &> /dev/null
fallocate -l 128M $dev

mkfs.btrfs -f -n 4k -m single -d single $dev
mount $dev $mnt -o nospace_cache,max_inline=2048

btrfs subvolume create $mnt/src
for i in $(seq -w 0 128); do
xfs_io -f -c "pwrite 0 2k" $mnt/src/file_$i > /dev/null
done
for i in $(seq -w 0 64); do
btrfs subvolume snapshot $mnt/src/ $mnt/snapshot_$i
touch $mnt/snapshot_$i/new
done
sync
------

The image triggers several corner cases that the old lowmem mode didn't
consider.

Like metadata backref with FULL_BACKREF flag and only SHARED_BLOCK_REF
backrefs for metadata.  And several tree reloc trees with shared
leaves/nodes to confuse old lowmem mode.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
tests/fsck-tests/020-extent-ref-cases/shared_block_ref_only.raw.xz [new file with mode: 0644]