btrfs: Test if btrfs hits EDQUOT without trying to reclaim some space
authorQu Wenruo <wqu@suse.com>
Tue, 29 Jan 2019 12:32:20 +0000 (20:32 +0800)
committerEryu Guan <guaneryu@gmail.com>
Wed, 30 Jan 2019 01:38:44 +0000 (09:38 +0800)
commit04e1a5e0678b9441fd74dca0f0fad92f9c029670
tree8c3213d851615896e3b61517aa78c70a476556e0
parent2065ab00791f10c82b2dc694fe3a41fb6760be5d
btrfs: Test if btrfs hits EDQUOT without trying to reclaim some space

Commit a514d63882c3 ("btrfs: qgroup: Commit transaction in advance
to reduce early EDQUOT") is no longer forcing transaction commit to
reclaim space, and only commits transaction asynchronously in
advance to address it.

However the criteria used in async transaction commit is not
comprehensive, thus it doesn't reclaim space automatically.

This test case will check the behavior by:
1) Falloc a large padding file
   This file will take 90% of the qgroup limit

2) Sync the fs
   To reflect the qgroup changes

3) Delete the file
   Qgroup won't reclaim the space until transaction committed.

4) Try to write a file
   If kernel not fixed, qgroup will not automatically commit transaction
   to reclaim the freed space and hit EDQUOT.

This bug is going to be fixed by a patch for kernel titled:
"btrfs: qgroup: Make qgroup async transaction commit more aggressive".

Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
tests/btrfs/180 [new file with mode: 0755]
tests/btrfs/180.out [new file with mode: 0644]
tests/btrfs/group