2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2017 SUSE. All Rights Reserved.
7 # Check if btrfs quota limits are not reached when you constantly
8 # create and delete files within the exclusive qgroup limits.
10 # Finally we create files to exceed the quota.
13 seqres=$RESULT_DIR/$seq
14 echo "QA output created by $seq"
18 status=1 # failure is the default!
19 trap "_cleanup; exit \$status" 0 1 2 3 15
27 # get standard environment, filters and checks
31 # remove previous $seqres.full before test
38 _scratch_mkfs > /dev/null 2>&1
41 SUBVOL=$SCRATCH_MNT/subvol
43 _run_btrfs_util_prog subvolume create $SUBVOL
44 _run_btrfs_util_prog quota enable $SCRATCH_MNT
45 _run_btrfs_util_prog quota rescan -w $SCRATCH_MNT
46 _run_btrfs_util_prog qgroup limit -e 1G $SUBVOL
49 # Write and delete files within 1G limits, multiple times
50 for i in $(seq 1 5); do
51 for j in $(seq 1 240); do
52 $XFS_IO_PROG -f -c "pwrite 0 4m" $SUBVOL/file_$j > /dev/null
57 # Exceed the limits here
58 for j in $(seq 1 8); do
59 $XFS_IO_PROG -f -c "pwrite 0 128m" $SUBVOL/file_$j 2>&1 | _filter_xfs_io | _filter_xfs_io_error