From ebb66f20aeee76a776d0d64502a9f85d6e8fb77b Mon Sep 17 00:00:00 2001 From: Naohiro Aota Date: Tue, 8 Dec 2015 11:07:13 +0900 Subject: 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 Signed-off-by: David Sterba --- .../012-leaf-corruption/no_data_extent.tar.xz | Bin 177600 -> 130260 bytes tests/fsck-tests/012-leaf-corruption/test.sh | 11 +++++++---- 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'tests/fsck-tests') 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 Binary files a/tests/fsck-tests/012-leaf-corruption/no_data_extent.tar.xz and b/tests/fsck-tests/012-leaf-corruption/no_data_extent.tar.xz 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() -- cgit v1.2.3