4 # Check if btrfs quota limits are not reached when you constantly
5 # create and delete files within the exclusive qgroup limits.
7 # Finally we create files to exceed the quota.
9 #-----------------------------------------------------------------------
10 # Copyright (c) 2017 SUSE. All Rights Reserved.
12 # This program is free software; you can redistribute it and/or
13 # modify it under the terms of the GNU General Public License as
14 # published by the Free Software Foundation.
16 # This program is distributed in the hope that it would be useful,
17 # but WITHOUT ANY WARRANTY; without even the implied warranty of
18 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 # GNU General Public License for more details.
21 # You should have received a copy of the GNU General Public License
22 # along with this program; if not, write the Free Software Foundation,
23 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24 #-----------------------------------------------------------------------
28 seqres=$RESULT_DIR/$seq
29 echo "QA output created by $seq"
33 status=1 # failure is the default!
34 trap "_cleanup; exit \$status" 0 1 2 3 15
42 # get standard environment, filters and checks
46 # remove previous $seqres.full before test
53 _scratch_mkfs > /dev/null 2>&1
56 SUBVOL=$SCRATCH_MNT/subvol
58 _run_btrfs_util_prog subvolume create $SUBVOL
59 _run_btrfs_util_prog quota enable $SCRATCH_MNT
60 _run_btrfs_util_prog quota rescan -w $SCRATCH_MNT
61 _run_btrfs_util_prog qgroup limit -e 1G $SUBVOL
64 # Write and delete files within 1G limits, multiple times
65 for i in $(seq 1 5); do
66 for j in $(seq 1 240); do
67 $XFS_IO_PROG -f -c "pwrite 0 4m" $SUBVOL/file_$j > /dev/null
72 # Exceed the limits here
73 for j in $(seq 1 8); do
74 $XFS_IO_PROG -f -c "pwrite 0 128m" $SUBVOL/file_$j 2>&1 | _filter_xfs_io | _filter_xfs_io_error