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.
40 _require_xfs_io_command falloc
42 _scratch_mkfs > /dev/null
45 $BTRFS_UTIL_PROG quota enable "$SCRATCH_MNT" > /dev/null
46 $BTRFS_UTIL_PROG quota rescan -w "$SCRATCH_MNT" > /dev/null
47 $BTRFS_UTIL_PROG qgroup limit -e 1G "$SCRATCH_MNT"
49 $XFS_IO_PROG -f -c "falloc 0 900M" "$SCRATCH_MNT/padding"
51 # Commit transaction to reflect the quota usage
54 rm -f "$SCRATCH_MNT/padding"
56 # Without the kernel fix, this will trigger EDQUOT.
57 _pwrite_byte 0xcd 0 512M "$SCRATCH_MNT/real_file" | _filter_xfs_io