@@ -18,6 +18,7 @@
source $TOP/tests/common
check_prereq btrfs
+check_global_prereq xfs_io
for img in *.img *.raw.xz
do
@@ -28,3 +29,17 @@ do
run_check $TOP/btrfs check "$image"
rm -f "$image"
done
+
+# Extra test case for partly written prealloc extents.
+test_prealloc_written()
+{
+ run_check $SUDO_HELPER $TOP/mkfs.btrfs -f $TEST_DEV
+
+ run_check_mount_test_dev
+ xfs_io -f -c "falloc 0 128k" -c "syncfs" $TEST_MNT/tmpfile
+ xfs_io -c "pwrite 0 64k" $TEST_MNT/tmpfile
+
+ run_check_umount_test_dev
+
+ run_check $TOP/btrfs check $TEST_DEV
+}
This is a bug found in lowmem mode, which reports false alert for partly written prealloc extent. Reported-by: Chris Murphy <chris@colorremedies.com> Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> --- tests/fsck-tests/020-extent-ref-cases/test.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+)