2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2015 Red Hat, Inc. All Rights Reserved.
5 # FS QA Test No. generic/347
7 # Test very basic thin device usage, exhaustion, and growth
11 seqres=$RESULT_DIR/$seq
12 echo "QA output created by $seq"
17 status=1 # failure is the default!
18 trap "_cleanup; exit \$status" 0 1 2 3 15
20 BACKING_SIZE=$((500 * 1024 * 1024 / 512)) # 500M
21 VIRTUAL_SIZE=$((10 * $BACKING_SIZE)) # 5000M
22 GROW_SIZE=$((100 * 1024 * 1024 / 512)) # 100M
32 _dmthin_init $BACKING_SIZE $VIRTUAL_SIZE
34 _mkfs_dev $DMTHIN_VOL_DEV
40 # Overfill it by a bit
41 for I in `seq 1 500`; do
42 $XFS_IO_PROG -f -c "pwrite -W 0 1M" $SCRATCH_MNT/file$I &>/dev/null
47 _dmthin_grow $GROW_SIZE
49 # Write a little more, but don't fill
50 for I in `seq 501 510`; do
51 $XFS_IO_PROG -f -c "pwrite 0 1M" $SCRATCH_MNT/file$I &>/dev/null
55 # get standard environment, filters and checks
60 _require_scratch_nocheck
61 _require_dm_target thin-pool