diff options
author | Qu Wenruo <wqu@suse.com> | 2024-04-19 14:57:24 +0930 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2024-07-11 15:33:19 +0200 |
commit | 839d6ea4f86de1d2e36a1b02561b4ccd597643b9 (patch) | |
tree | e8f3cca06c6acf3b16082233954bcbdc4756ee65 /fs/btrfs/backref.h | |
parent | a776bf5f3c2300cfdf8a195663460b1793ac9847 (diff) |
btrfs: automatically remove the subvolume qgroup
Currently if we fully clean a subvolume (not only delete its directory,
but fully clean all it's related data and root item), the associated
qgroup would not be removed.
We have "btrfs qgroup clear-stale" to handle such 0 level qgroups.
Change the behavior to automatically removie the qgroup of a fully
cleaned subvolume when possible:
- Full qgroup but still consistent
We can and should remove the qgroup.
The qgroup numbers should be 0, without any rsv.
- Full qgroup but inconsistent
Can happen with drop_subtree_threshold feature (skip accounting
and mark qgroup inconsistent).
We can and should remove the qgroup.
Higher level qgroup numbers will be incorrect, but since qgroup
is already inconsistent, it should not be a problem.
- Squota mode
This is the special case, we can only drop the qgroup if its numbers
are all 0.
This would be handled by can_delete_qgroup(), so we only need to check
the return value and ignore the -EBUSY error.
Link: https://bugzilla.suse.com/show_bug.cgi?id=1222847
Reviewed-by: Boris Burkov <boris@bur.io>
Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/backref.h')
0 files changed, 0 insertions, 0 deletions