On 2018/11/27 下午3:29, Nikolay Borisov wrote: > > > On 27.11.18 г. 4:33 ч., Qu Wenruo wrote: >> Test case misc/021 is testing if we could mount a single disk btrfs >> image recovered from multi disk fs. >> >> The problem is, current kernel has extra check for block group, chunk >> and dev extent. >> This means any image can't pass btrfs check for chunk tree will not >> mount. >> >> So do extra btrfs check before mount, this will also help us to locate >> the problem in btrfs-image easier. >> >> Signed-off-by: Qu Wenruo <wqu@xxxxxxxx> >> --- >> tests/misc-tests/021-image-multi-devices/test.sh | 3 +++ >> 1 file changed, 3 insertions(+) >> >> diff --git a/tests/misc-tests/021-image-multi-devices/test.sh b/tests/misc-tests/021-image-multi-devices/test.sh >> index 5430847f4e2f..26beae6e4b85 100755 >> --- a/tests/misc-tests/021-image-multi-devices/test.sh >> +++ b/tests/misc-tests/021-image-multi-devices/test.sh >> @@ -37,6 +37,9 @@ run_check $SUDO_HELPER wipefs -a "$loop2" >> >> run_check $SUDO_HELPER "$TOP/btrfs-image" -r "$IMAGE" "$loop1" >> >> +# Run check to make sure there is nothing wrong for the recovered image >> +run_check "$TOP/btrfs" check "$loop1" > > I think this needs to be run_check $SUDO_HELPER "$TOP/btrfs" check "$loop1" For read-only check, it's OK and I always run the tests using normal user, no privilege problem. Thanks, Qu >> + >> run_check $SUDO_HELPER mount "$loop1" "$TEST_MNT" >> new_md5=$(run_check_stdout md5sum "$TEST_MNT/foobar" | cut -d ' ' -f 1) >> run_check $SUDO_HELPER umount "$TEST_MNT" >>
