@@ -245,7 +245,7 @@ _btrfs_stress_balance()
{
local options=$@
while true; do
- $BTRFS_UTIL_PROG balance start $options
+ _run_btrfs_balance_start $options >> $seqres.full
done
}
@@ -113,7 +113,7 @@ _test_add()
_fail "wipefs failed"
$BTRFS_UTIL_PROG device add ${devs[$i]} $SCRATCH_MNT >> $seqres.full 2>&1 || _fail "device add failed"
done
- $BTRFS_UTIL_PROG filesystem balance $SCRATCH_MNT >> $seqres.full 2>&1 || _fail "balance failed"
+ _run_btrfs_balance_start $SCRATCH_MNT >> $seqres.full
_scratch_unmount
}
@@ -159,7 +159,7 @@ _test_replace()
# in some system balance fails if there is no delay (a bug)
# putting sleep 10 to work around as of now
# sleep 10
- $BTRFS_UTIL_PROG filesystem balance $SCRATCH_MNT >> $seqres.full 2>&1 || _fail "dev balance failed"
+ _run_btrfs_balance_start $SCRATCH_MNT >> $seqres.full
# cleaup. add the removed disk
_scratch_unmount
@@ -56,8 +56,7 @@ _check_csum_error()
}
$XFS_IO_PROG -f -c "falloc 0 1M" -c "pwrite 16k 8k" -c "fsync" \
$SCRATCH_MNT/foo > $seqres.full 2>&1
-$BTRFS_UTIL_PROG filesystem balance $SCRATCH_MNT >> $seqres.full 2>&1 || \
- _fail "balance failed"
+_run_btrfs_balance_start $SCRATCH_MNT >> $seqres.full
_scratch_unmount
_scratch_mount
$XFS_IO_PROG -c "pread 0 1M" $SCRATCH_MNT/foo >> $seqres.full 2>&1 || \
@@ -27,7 +27,7 @@ _balance()
{
for i in $(seq 20)
do
- $BTRFS_UTIL_PROG balance start $SCRATCH_MNT >/dev/null
+ _run_btrfs_balance_start $SCRATCH_MNT >> $seqres.full
done
}
@@ -31,7 +31,7 @@ _cleanup()
# real QA test starts here
run_test()
{
- $BTRFS_UTIL_PROG balance start $SCRATCH_MNT >> $seqres.full &
+ _run_btrfs_balance_start $SCRATCH_MNT >> $seqres.full &
sleep 0.5
@@ -47,7 +47,7 @@ _require_fs_space $SCRATCH_MNT $((2 * 1024 * 1024))
# mkfs created. We could also wait for the background kthread to automatically
# delete the unused block group, but we do not have a way to make it run and
# wait for it to complete, so just do a balance instead of some unreliable sleep
-_run_btrfs_util_prog balance start -dusage=0 $SCRATCH_MNT
+_run_btrfs_balance_start -dusage=0 $SCRATCH_MNT >> $seqres.full
# Now unmount the filesystem, mount it again (either with or with space caches
# enabled, it does not matter to trigger the problem) and attempt to create a
@@ -59,7 +59,7 @@ _run_btrfs_util_prog quota enable $SCRATCH_MNT
_run_btrfs_util_prog quota rescan -w $SCRATCH_MNT
# now balance data block groups to corrupt qgroup
-_run_btrfs_util_prog balance start -d $SCRATCH_MNT
+_run_btrfs_balance_start -d $SCRATCH_MNT >> $seqres.full
_scratch_unmount
# qgroup will be check at _check_scratch_fs() by fstest
@@ -123,7 +123,7 @@ _run_btrfs_util_prog device scan
_scratch_mount >> $seqres.full 2>&1
echo >> $seqres.full
-_run_btrfs_util_prog balance start ${SCRATCH_MNT}
+_run_btrfs_balance_start $SCRATCH_MNT >> $seqres.full
_run_btrfs_util_prog filesystem show
_run_btrfs_util_prog filesystem df ${SCRATCH_MNT}
@@ -129,8 +129,8 @@ balance_convert()
echo
echo "run balance"
- _run_btrfs_util_prog balance start --full-balance -dconvert=raid1 \
- -mconvert=raid1 ${SCRATCH_MNT}
+ _run_btrfs_balance_start -dconvert=raid1 \
+ -mconvert=raid1 $SCRATCH_MNT >> $seqres.full
}
verify()
@@ -70,14 +70,14 @@ sync
# Now we have take at least 50% of the filesystem, relocate all chunks twice
# so all chunks will start after 1G in logical space.
# (Btrfs chunk allocation will not rewind to reuse lower space)
-_run_btrfs_util_prog balance start --full-balance "$SCRATCH_MNT"
+_run_btrfs_balance_start $SCRATCH_MNT >> $seqres.full
# To avoid possible false ENOSPC alert on v4.15-rc1, seems to be a
# reserved space related bug (maybe related to outstanding space rework?),
# but that's another story.
sync
-_run_btrfs_util_prog balance start --full-balance "$SCRATCH_MNT"
+_run_btrfs_balance_start $SCRATCH_MNT >> $seqres.full
# Now remove half of the files to make some holes for later trim.
# While still keep the chunk space fragmented, so no chunk will be freed
@@ -68,7 +68,7 @@ sync
before_gen=$(get_super_gen)
-$BTRFS_UTIL_PROG balance start -m "$SCRATCH_MNT" > /dev/null
+_run_btrfs_balance_start -m $SCRATCH_MNT >> $seqres.full
after_gen=$(get_super_gen)
@@ -53,7 +53,7 @@ for ((i = 0; i < $nr_files; i++)) do
_pwrite_byte 0xcd 0 1K "$SCRATCH_MNT/subvol/file_$i" > /dev/null
done
-$BTRFS_UTIL_PROG balance start -m "$SCRATCH_MNT" > /dev/null
+_run_btrfs_balance_start -m $SCRATCH_MNT >> $seqres.full
# success, all done
echo "Silence is golden"
@@ -84,7 +84,7 @@ balance_loop()
# easier to hit problems (crashes and errors) in send.
# Ignore errors from balance. We just want to test for crashes
# and deadlocks.
- $BTRFS_UTIL_PROG balance start -f -m $SCRATCH_MNT &> /dev/null
+ _run_btrfs_balance_start -f -m $SCRATCH_MNT &> /dev/null
sleep $((RANDOM % 3))
done
}
@@ -59,7 +59,8 @@ sync
# Balance metadata so we will have at least one transaction committed with
# valid reloc tree, and hopefully another commit with orphan reloc tree.
-$BTRFS_UTIL_PROG balance start -f -m $SCRATCH_MNT >> $seqres.full
+_run_btrfs_balance_start -f -m $SCRATCH_MNT >> $seqres.full
+
_log_writes_unmount
_log_writes_remove
@@ -64,7 +64,7 @@ run_testcase() {
# Create random filesystem with 20k write ops
$FSSTRESS_PROG -d $SCRATCH_MNT -w -n 10000 $FSSTRESS_AVOID >>$seqres.full 2>&1
- $BTRFS_UTIL_PROG balance start -f -dconvert=$dst_type $SCRATCH_MNT >> $seqres.full 2>&1
+ _run_btrfs_balance_start -f -dconvert=$dst_type $SCRATCH_MNT >> $seqres.full
[ $? -eq 0 ] || echo "$1: Failed convert"
$BTRFS_UTIL_PROG scrub start -B $SCRATCH_MNT >>$seqres.full 2>&1