From: Josef Bacik <josef@toxicpanda.com>
To: Qu Wenruo <wqu@suse.com>, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH 1/3] btrfs: Introduce extent_changeset_revert() for qgroup
Date: Thu, 2 Jul 2020 09:40:53 -0400 [thread overview]
Message-ID: <b716bb32-b5e6-54a5-ac42-ca559dfd2d3a@toxicpanda.com> (raw)
In-Reply-To: <20200702001434.7745-2-wqu@suse.com>
On 7/1/20 8:14 PM, Qu Wenruo wrote:
> [PROBLEM]
> Before this patch, when btrfs_qgroup_reserve_data() fails, we free all
> reserved space of the changeset.
>
> This means the following call is not possible:
> ret = btrfs_qgroup_reserve_data();
> if (ret == -EDQUOT) {
> /* Do something to free some qgroup space */
> ret = btrfs_qgroup_reserve_data();
> }
>
> As if the first btrfs_qgroup_reserve_data() fails, it will free all
> reserved qgroup space, so the next btrfs_qgroup_reserve_data() will
> always success, and can go beyond qgroup limit.
>
> [CAUSE]
> This is mostly due to the fact that we don't have a good way to revert
> changeset modification accurately.
>
> Currently the changeset infrastructure is implemented using ulist, which
> can only store two u64 values, used as start and length for each changed
> extent range.
>
> So we can't record which changed extent is modified in last
> modification, thus unable to revert to previous status.
>
> [FIX]
> This patch will re-implement using pure rbtree, adding a new member,
> changed_extent::seq, so we can remove changed extents which is
> modified in previous modification.
>
> This allows us to implement qgroup_revert(), which allow btrfs to revert
> its modification to the io_tree.
>
I'm having a hard time groking what's going on here. These changesets are
limited to a [start, end] range correct? Why can we have multiple changesets
for the same range? Are we reserving doubly for modifications in the same
range? Because it seems here if you find your changeset at all we'll clear the
io_tree, but if you can have multiple changesets for the same range then....why
even bother? Thanks,
Josef
next prev parent reply other threads:[~2020-07-02 13:40 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-02 0:14 [PATCH 0/3] btrfs: qgroup: Fix the long existing regression of btrfs/153 Qu Wenruo
2020-07-02 0:14 ` [PATCH 1/3] btrfs: Introduce extent_changeset_revert() for qgroup Qu Wenruo
2020-07-02 13:40 ` Josef Bacik [this message]
2020-07-02 13:50 ` Qu Wenruo
2020-07-02 13:56 ` Josef Bacik
2020-07-02 14:07 ` Qu Wenruo
2020-07-02 0:14 ` [PATCH 2/3] btrfs: qgroup: Try to flush qgroup space when we get -EDQUOT Qu Wenruo
2020-07-02 13:43 ` Josef Bacik
2020-07-02 13:54 ` Qu Wenruo
2020-07-02 13:57 ` Josef Bacik
2020-07-02 14:19 ` Qu Wenruo
2020-07-02 14:58 ` Josef Bacik
2020-07-02 23:36 ` Qu Wenruo
2020-07-02 0:14 ` [PATCH 3/3] Revert "btrfs: qgroup: Commit transaction in advance to reduce early EDQUOT" Qu Wenruo
2020-07-02 13:11 ` David Sterba
2020-07-02 13:22 ` [PATCH 0/3] btrfs: qgroup: Fix the long existing regression of btrfs/153 David Sterba
2020-07-02 13:28 ` Josef Bacik
2020-07-02 13:41 ` David Sterba
2020-07-02 13:44 ` Josef Bacik
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=b716bb32-b5e6-54a5-ac42-ca559dfd2d3a@toxicpanda.com \
--to=josef@toxicpanda.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=wqu@suse.com \
/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