2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (C) 2019 SUSE Linux Products GmbH. All Rights Reserved.
7 # Test if btrfs hits EDQUOT without reclaiming already freed extents when quota
10 # This bug is going to be fxied by a patch for kernel titled
11 # "btrfs: qgroup: Make qgroup async transaction commit more aggressive"
14 seqres=$RESULT_DIR/$seq
15 echo "QA output created by $seq"
19 status=1 # failure is the default!
20 trap "_cleanup; exit \$status" 0 1 2 3 15
28 # get standard environment, filters and checks
32 # remove previous $seqres.full before test
35 # real QA test starts here
37 # Modify as appropriate.
41 _require_xfs_io_command falloc
43 _scratch_mkfs > /dev/null
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"
50 $XFS_IO_PROG -f -c "falloc 0 900M" "$SCRATCH_MNT/padding"
52 # Commit transaction to reflect the quota usage
55 rm -f "$SCRATCH_MNT/padding"
57 # Without the kernel fix, this will trigger EDQUOT.
58 _pwrite_byte 0xcd 0 512M "$SCRATCH_MNT/real_file" | _filter_xfs_io