2 # Confirm btrfs check can check file extents without causing false alert
4 source $TOP/tests
/common
7 check_prereq mkfs.btrfs
8 check_global_prereq xfs_io
9 check_global_prereq fallocate
14 # Do some write into a large prealloc range
15 # Lowmem mode can report missing csum due to wrong csum range
16 test_paritical_write_into_prealloc
()
18 run_check
$SUDO_HELPER "$TOP/mkfs.btrfs" -f "$TEST_DEV"
19 run_check_mount_test_dev
21 run_check fallocate
-l 128K
"$TEST_MNT/file"
23 run_check xfs_io
-c "pwrite 0 64K" "$TEST_MNT/file"
24 run_check_umount_test_dev
25 run_check
"$TOP/btrfs" check
"$TEST_DEV"
28 # Inline compressed file extent
29 # Lowmem mode can cause silent error without any error message
30 # due to too restrict check on inline extent size
31 test_compressed_inline_extent
()
33 run_check
$SUDO_HELPER "$TOP/mkfs.btrfs" -f "$TEST_DEV"
34 run_check_mount_test_dev
-o compress=lzo
,max_inline
=2048
36 run_check xfs_io
-f -c "pwrite 0 1K" "$TEST_MNT/file"
37 run_check_umount_test_dev
38 run_check
"$TOP/btrfs" check
"$TEST_DEV"
41 test_paritical_write_into_prealloc
42 test_compressed_inline_extent