From: Qu Wenruo <wqu@suse.com>
To: linux-btrfs@vger.kernel.org
Cc: boris@bur.io
Subject: [PATCH v2 0/2] btrfs: qgroup: stale qgroups related impromvents
Date: Fri, 19 Apr 2024 19:16:51 +0930 [thread overview]
Message-ID: <cover.1713519718.git.wqu@suse.com> (raw)
[CHANGELOG]
v2:
- Do more sanity checks before deleting a qgroup
- Make squota to handle auto deleted qgroup more gracefully
Unfortunately the behavior change would affect btrfs/301, as the
fully deleted subvolume would make the test case to cause bash grammar
error (since the qgroup is gone with the subvolume).
Cc Boris for extra comments on squota compatibility and future
btrfs/311 updates ideas.
We have two problems in recent qgroup code:
- One can not delete a fully removed qgroup if the drop hits
drop_subtree_threshold
As hitting drop_subtree_threshold would mark qgroup inconsistent and
skip all accounting, this would leave qgroup number untouched (thus
non-zero), and btrfs refuses to delete qgroup with non-zero rfer/excl
numbers.
This would be addressed by the first patch, allowing qgroup
deletion as long as it doesn't have any child nor a corresponding
subvolume.
- Deleted subvolumes leaves a stale qgroup until next rescan
This is a long existing problem.
Although previous pushes all failed, just let me try it again.
The idea is commit current transaction if needed (full accounting mode
and qgroup numbers are consistent), then try to remove the subvolume
qgroup after it is fully dropped.
Qu Wenruo (2):
btrfs: slightly loose the requirement for qgroup removal
btrfs: automatically remove the subvolume qgroup
fs/btrfs/extent-tree.c | 8 +++
fs/btrfs/qgroup.c | 108 ++++++++++++++++++++++++++++++++++++++---
fs/btrfs/qgroup.h | 2 +
3 files changed, 110 insertions(+), 8 deletions(-)
--
2.44.0
next reply other threads:[~2024-04-19 9:47 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-19 9:46 Qu Wenruo [this message]
2024-04-19 9:46 ` [PATCH v2 1/2] btrfs: slightly loose the requirement for qgroup removal Qu Wenruo
2024-04-29 12:47 ` Boris Burkov
2024-04-29 22:00 ` Qu Wenruo
2024-04-29 22:19 ` Boris Burkov
2024-04-29 22:29 ` Qu Wenruo
2024-04-29 22:38 ` Boris Burkov
2024-04-19 9:46 ` [PATCH v2 2/2] btrfs: automatically remove the subvolume qgroup Qu Wenruo
2024-04-24 12:41 ` David Sterba
2024-04-24 22:19 ` Qu Wenruo
2024-04-25 12:34 ` David Sterba
2024-04-25 21:51 ` Qu Wenruo
2024-04-29 13:13 ` Boris Burkov
2024-04-29 16:31 ` David Sterba
2024-04-29 22:05 ` Qu Wenruo
2024-04-30 10:59 ` David Sterba
2024-04-30 22:05 ` Qu Wenruo
2024-04-30 22:18 ` Boris Burkov
2024-04-30 22:27 ` Qu Wenruo
2024-05-02 15:03 ` David Sterba
2024-05-02 21:29 ` Qu Wenruo
2024-05-03 12:46 ` David Sterba
2024-05-03 22:14 ` Qu Wenruo
2024-05-02 15:00 ` David Sterba
2024-05-02 21:27 ` Qu Wenruo
2024-04-29 22:49 ` Qu Wenruo
2024-04-29 16:36 ` David Sterba
2024-04-29 12:57 ` Boris Burkov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cover.1713519718.git.wqu@suse.com \
--to=wqu@suse.com \
--cc=boris@bur.io \
--cc=linux-btrfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox