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 _begin_fstest auto quick rw thin
13 BACKING_SIZE=$((500 * 1024 * 1024 / 512)) # 500M
14 VIRTUAL_SIZE=$((10 * $BACKING_SIZE)) # 5000M
15 GROW_SIZE=$((100 * 1024 * 1024 / 512)) # 100M
17 # Override the default cleanup function.
26 _dmthin_init $BACKING_SIZE $VIRTUAL_SIZE
34 # Overfill it by a bit
35 for I in `seq 1 500`; do
36 $XFS_IO_PROG -f -c "pwrite -W 0 1M" $SCRATCH_MNT/file$I &>/dev/null
41 _dmthin_grow $GROW_SIZE
43 # Write a little more, but don't fill
44 for I in `seq 501 510`; do
45 $XFS_IO_PROG -f -c "pwrite 0 1M" $SCRATCH_MNT/file$I &>/dev/null
49 # Import common functions.
53 _require_scratch_nocheck
54 _require_dm_target thin-pool