This is a bug found in lowmem mode, which reports false alert for partly
written prealloc extent.

Reported-by: Chris Murphy <ch...@colorremedies.com>
Signed-off-by: Qu Wenruo <quwen...@cn.fujitsu.com>
---
 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



--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to