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 _begin_fstest auto quick qgroup limit
16 # Import common functions.
19 # real QA test starts here
21 # Modify as appropriate.
24 _require_xfs_io_command falloc
26 _scratch_mkfs > /dev/null
29 $BTRFS_UTIL_PROG quota enable "$SCRATCH_MNT" > /dev/null
30 $BTRFS_UTIL_PROG quota rescan -w "$SCRATCH_MNT" > /dev/null
31 $BTRFS_UTIL_PROG qgroup limit -e 1G "$SCRATCH_MNT"
33 $XFS_IO_PROG -f -c "falloc 0 900M" "$SCRATCH_MNT/padding"
35 # Commit transaction to reflect the quota usage
38 rm -f "$SCRATCH_MNT/padding"
40 # Without the kernel fix, this will trigger EDQUOT.
41 _pwrite_byte 0xcd 0 512M "$SCRATCH_MNT/real_file" | _filter_xfs_io