From 1ea7292354eefaf704e5b2d5c9e56cad25509e9b Mon Sep 17 00:00:00 2001 From: Qu Wenruo Date: Tue, 9 May 2023 08:43:15 +0800 Subject: [PATCH] btrfs-progs: tests: convert: add a test case to check the csum for the image file The new test case would create an empty ext4 with 64K block size, which can lead to a new data chunk which is no longer 1:1 mapped. Then convert the fs and verify it with --check-data-csum to make sure the image file is fine. Reviewed-by: Anand Jain Signed-off-by: Qu Wenruo Signed-off-by: David Sterba --- .../023-64k-blocksize-migrated/test.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100755 tests/convert-tests/023-64k-blocksize-migrated/test.sh diff --git a/tests/convert-tests/023-64k-blocksize-migrated/test.sh b/tests/convert-tests/023-64k-blocksize-migrated/test.sh new file mode 100755 index 00000000..ad7da5a2 --- /dev/null +++ b/tests/convert-tests/023-64k-blocksize-migrated/test.sh @@ -0,0 +1,16 @@ +#!/bin/bash +# Make sure the migrated range doesn't cause csum errors + +source "$TEST_TOP/common" || exit +source "$TEST_TOP/common.convert" || exit + +setup_root_helper +prepare_test_dev 10G + +check_global_prereq mkfs.ext4 +check_prereq btrfs-convert +check_prereq btrfs + +run_check mkfs.ext4 -b 64K -F "$TEST_DEV" +run_check $SUDO_HELPER "$TOP/btrfs-convert" --nodesize 64K "$TEST_DEV" +run_check $SUDO_HELPER "$TOP/btrfs" check --check-data-csum "$TEST_DEV"