mirror of
https://github.com/kdave/btrfs-progs
synced 2024-12-26 08:02:21 +00:00
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>
This commit is contained in:
parent
9c572c38a1
commit
ebb66f20ae
Binary file not shown.
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user