[PATCH 8/9] btrfs-progs: fsck-tests: Add new test case for partly written prealloc extent
From: Qu Wenruo <hidden>
Date: 2017-01-23 09:15:15
Subsystem:
the rest · Maintainer:
Linus Torvalds
From: Qu Wenruo <hidden>
Date: 2017-01-23 09:15:15
Subsystem:
the rest · Maintainer:
Linus Torvalds
This is a bug found in lowmem mode, which reports false alert for partly written prealloc extent. Reported-by: Chris Murphy <redacted> Signed-off-by: Qu Wenruo <redacted> --- tests/fsck-tests/020-extent-ref-cases/test.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
diff --git a/tests/fsck-tests/020-extent-ref-cases/test.sh b/tests/fsck-tests/020-extent-ref-cases/test.sh
index 5dc5e55d..91340671 100755
--- a/tests/fsck-tests/020-extent-ref-cases/test.sh
+++ b/tests/fsck-tests/020-extent-ref-cases/test.sh@@ -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 +}
--
2.11.0