mount command in old system can not add "-o loop" option automatically
for loop device, and make following test failed:
# ./fsck-tests.sh
...
[TEST] 013-extent-tree-rebuild
failed: mount /data/btrfsprogs/tests/test.img /data/btrfsprogs/tests/mnt
test failed for case 013-extent-tree-rebuild
Considering that $TEST_DEV can be block or loop device, we need determine
our mount option in a condition for both case.
This patch create a wrapper function for above request, to solve current
problem in 013-extent-tree-rebuild, and support similar request in future.
Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.com>
{
run_check $SUDO_HELPER $TOP/mkfs.btrfs -f $TEST_DEV
- run_check $SUDO_HELPER mount $TEST_DEV $TEST_MNT
+ run_check_mount_test_dev
run_check $SUDO_HELPER cp -aR /lib/modules/`uname -r`/ $TEST_MNT
for i in `seq 1 100`;do
run_check $SUDO_HELPER $TOP/btrfs sub snapshot $TEST_MNT \
$TEST_MNT/snapaaaaaaa_$i
done
- run_check $SUDO_HELPER umount $TEST_DEV
+ run_check_umount_test_dev
# get extent root bytenr
extent_root_bytenr=`$SUDO_HELPER $TOP/btrfs-debug-tree -r $TEST_DEV | \