xfs/{263,106}: erase max warnings printout
[xfstests-dev.git] / tests / btrfs / 180
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (C) 2019 SUSE Linux Products GmbH. All Rights Reserved.
4 #
5 # FS QA Test 180
6 #
7 # Test if btrfs hits EDQUOT without reclaiming already freed extents when quota
8 # is enabled.
9 #
10 # This bug is going to be fxied by a patch for kernel titled
11 # "btrfs: qgroup: Make qgroup async transaction commit more aggressive"
12 #
13 seq=`basename $0`
14 seqres=$RESULT_DIR/$seq
15 echo "QA output created by $seq"
16
17 here=`pwd`
18 tmp=/tmp/$$
19 status=1        # failure is the default!
20 trap "_cleanup; exit \$status" 0 1 2 3 15
21
22 _cleanup()
23 {
24         cd /
25         rm -f $tmp.*
26 }
27
28 # get standard environment, filters and checks
29 . ./common/rc
30 . ./common/filter
31
32 # remove previous $seqres.full before test
33 rm -f $seqres.full
34
35 # real QA test starts here
36
37 # Modify as appropriate.
38 _supported_fs btrfs
39 _supported_os Linux
40 _require_scratch
41 _require_xfs_io_command falloc
42
43 _scratch_mkfs > /dev/null
44 _scratch_mount
45
46 $BTRFS_UTIL_PROG quota enable "$SCRATCH_MNT" > /dev/null
47 $BTRFS_UTIL_PROG quota rescan -w "$SCRATCH_MNT" > /dev/null
48 $BTRFS_UTIL_PROG qgroup limit -e 1G "$SCRATCH_MNT"
49
50 $XFS_IO_PROG -f -c "falloc 0 900M" "$SCRATCH_MNT/padding"
51
52 # Commit transaction to reflect the quota usage
53 sync
54
55 rm -f "$SCRATCH_MNT/padding"
56
57 # Without the kernel fix, this will trigger EDQUOT.
58 _pwrite_byte 0xcd 0 512M "$SCRATCH_MNT/real_file" | _filter_xfs_io
59
60 # success, all done
61 status=0
62 exit