dev_size=$((1024 * 1024 * 1024)) # 1GB filesystem
_scratch_mkfs_sized $dev_size >>$seqres.full 2>&1
_scratch_mount
+file_size=`_mb_pct_of_available_space $SCRATCH_DEV 80`
for ((i = 0; i < 10; i++)); do
echo "loop $i" >>$seqres.full
- $XFS_IO_PROG -f -c "pwrite -b 1m 0 800m" "$SCRATCH_MNT"/file | \
-_filter_xfs_io | _filter_scratch
+ $XFS_IO_PROG -f -c "pwrite -b 1m 0 ${file_size}m" "$SCRATCH_MNT"/file | \
+_filter_xfs_io_numbers | _filter_scratch
rm -f "$SCRATCH_MNT"/file
done
QA output created by 102
-wrote 838860800/838860800 bytes at offset 0
+wrote XXXX/XXXX bytes at offset XXXX
XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-wrote 838860800/838860800 bytes at offset 0
+wrote XXXX/XXXX bytes at offset XXXX
XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-wrote 838860800/838860800 bytes at offset 0
+wrote XXXX/XXXX bytes at offset XXXX
XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-wrote 838860800/838860800 bytes at offset 0
+wrote XXXX/XXXX bytes at offset XXXX
XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-wrote 838860800/838860800 bytes at offset 0
+wrote XXXX/XXXX bytes at offset XXXX
XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-wrote 838860800/838860800 bytes at offset 0
+wrote XXXX/XXXX bytes at offset XXXX
XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-wrote 838860800/838860800 bytes at offset 0
+wrote XXXX/XXXX bytes at offset XXXX
XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-wrote 838860800/838860800 bytes at offset 0
+wrote XXXX/XXXX bytes at offset XXXX
XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-wrote 838860800/838860800 bytes at offset 0
+wrote XXXX/XXXX bytes at offset XXXX
XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-wrote 838860800/838860800 bytes at offset 0
+wrote XXXX/XXXX bytes at offset XXXX
XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
blksz="$(_get_block_size $testdir)"
_scratch_unmount
-file_size=$((768 * 1024 * 1024))
fs_size=$((1024 * 1024 * 1024))
_scratch_mkfs_sized $fs_size >> $seqres.full 2>&1
_scratch_mount >> $seqres.full 2>&1
rm -rf $testdir
mkdir $testdir
+file_size=`_mb_pct_of_available_space $SCRATCH_DEV 70`
echo "Create a big file and reflink it"
-_pwrite_byte 0x61 0 $file_size $testdir/bigfile >> $seqres.full 2>&1
+_pwrite_byte 0x61 0 ${file_size}m $testdir/bigfile >> $seqres.full 2>&1
_cp_reflink $testdir/bigfile $testdir/clonefile
_scratch_sync
_scratch_sync
echo "CoW the big file"
-out="$(_pwrite_byte 0x62 0 $file_size $testdir/bigfile 2>&1 | \
+out="$(_pwrite_byte 0x62 0 ${file_size}m $testdir/bigfile 2>&1 | \
_filter_xfs_io_error)"
echo ${out} | grep -q "No space left on device" || echo "CoW should have failed with ENOSPC"
echo ${out} >> $seqres.full 2>&1
echo "Remount and try CoW again"
_scratch_cycle_mount
-out="$(_pwrite_byte 0x62 0 $file_size $testdir/bigfile 2>&1 | \
+out="$(_pwrite_byte 0x62 0 ${file_size}m $testdir/bigfile 2>&1 | \
_filter_xfs_io_error)"
echo ${out} | grep -q "No space left on device" || echo "CoW should have failed with ENOSPC"
echo ${out} >> $seqres.full 2>&1
VIRTUAL_SIZE=$((10 * $BACKING_SIZE)) # 5000M
GROW_SIZE=$((100 * 1024 * 1024 / 512)) # 100M
+dmthin_mkfs_opts=""
+if [ $FSTYP == "xfs" ]; then
+ if _scratch_mkfs_xfs_supports_concurrency -l >> $seqres.full 2>&1; then
+ dmthin_mkfs_opts="-l concurrency=0"
+ fi
+fi
+
# Override the default cleanup function.
_cleanup()
{
{
_dmthin_init $BACKING_SIZE $VIRTUAL_SIZE
_dmthin_set_queue
- _dmthin_mkfs
+ _dmthin_mkfs $dmthin_mkfs_opts
_dmthin_mount
}