summaryrefslogtreecommitdiff
path: root/tests/fsck-tests
diff options
context:
space:
mode:
authorNaohiro Aota <naota@elisp.net>2015-12-08 11:07:13 +0900
committerDavid Sterba <dsterba@suse.com>2016-01-12 15:01:03 +0100
commitebb66f20aeee76a776d0d64502a9f85d6e8fb77b (patch)
tree5dd736bb596dcbdb6797bc6f87a9d3e0748c45bf /tests/fsck-tests
parent9c572c38a1dd87cdbe1f9811ac17eff90f6c10c0 (diff)
btrfs-progs: tests: test multiple-linked file corruption
This commit extends the leaf corruption test to try to repair a file linked from multiple directory. It stresses a case that some links to a file is broken but others kept valid. Signed-off-by: Naohiro Aota <naota@elisp.net> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'tests/fsck-tests')
-rw-r--r--tests/fsck-tests/012-leaf-corruption/no_data_extent.tar.xzbin177600 -> 130260 bytes
-rwxr-xr-xtests/fsck-tests/012-leaf-corruption/test.sh11
2 files changed, 7 insertions, 4 deletions
diff --git a/tests/fsck-tests/012-leaf-corruption/no_data_extent.tar.xz b/tests/fsck-tests/012-leaf-corruption/no_data_extent.tar.xz
index cc90b58e..547e5455 100644
--- a/tests/fsck-tests/012-leaf-corruption/no_data_extent.tar.xz
+++ b/tests/fsck-tests/012-leaf-corruption/no_data_extent.tar.xz
Binary files differ
diff --git a/tests/fsck-tests/012-leaf-corruption/test.sh b/tests/fsck-tests/012-leaf-corruption/test.sh
index 6e231451..830fd8d5 100755
--- a/tests/fsck-tests/012-leaf-corruption/test.sh
+++ b/tests/fsck-tests/012-leaf-corruption/test.sh
@@ -29,6 +29,7 @@ leaf_no_data_ext_list=(
1869 0 40700 "snmp"
1871 0 100700 "machine-id"
1872 0 100700 "adjtime"
+ 1877 0 40700 "del"
)
generate_leaf_corrupt_no_data_ext()
@@ -40,10 +41,12 @@ generate_leaf_corrupt_no_data_ext()
$TOP/btrfs-image -r test.img.btrfs-image $dest || \
_fail "failed to extract leaf_corrupt_no_data_ext.btrfs-image"
- # leaf at 20832256 contains no regular data extent, clear its csum to
- # corrupt the leaf.
- dd if=/dev/zero of=$dest bs=1 count=32 conv=notrunc seek=20832256 \
- 1>/dev/null 2>&1
+ # leaf at 4206592 and 20905984 contains no regular data
+ # extent, clear its csum to corrupt the leaf.
+ for x in 4206592 20905984; do
+ dd if=/dev/zero of=$dest bs=1 count=32 conv=notrunc seek=$x \
+ 1>/dev/null 2>&1
+ done
}
check_inode()