Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

qgroup destroy: warn if qgroup cannot be removed after subvolume deletion #782

Open
kdave opened this issue Apr 30, 2024 · 1 comment
Open
Labels

Comments

@kdave
Copy link
Owner

kdave commented Apr 30, 2024

Removing a stale qgroup may not succeed for several reasons:

https://lore.kernel.org/linux-btrfs/fa8f65936f31c07ca4783229140ecfb1f7ada785.1714082499.git.wqu@suse.com/ :

  • Currently kernel doesn not allow to delete non-empty qgroups
  • A qgroup can only be empty after fully dropped and a transaction is committed
  • Things like drop_subtree_threshold or other operations can mark qgroup inconsistent and skip accounting

The option --delete-qgroup has been removed but the same can happen with btrfs qgroup destroy as it's the same implementation by an ioctl.

We need to catch the conditions preventing the deletion and warn, or add options that will try to do the right thing at some cost, like waiting until the subvolume is cleaned.

@kdave kdave added the bug label Apr 30, 2024
@adam900710
Copy link
Collaborator

This sounds very reasonable and would be much more user friendly.

I'll add this feature soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants